Object of type 'String' cannot be converted to type 'Function'
2009-12-14 11:37
495 查看
网页错误详细信息 用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
时间戳: Mon, 14 Dec 2009 03:32:55 UTC 消息: Sys.ArgumentTypeException: Object of type 'String' cannot be converted to type 'Function'.
Parameter name: onSuccess
行: 4770
字符: 16
代码: 0
URI: http://localhost:6388/webs/ScriptResource.axd?d=d_Q0Ax-QZTcQtQQuRVnReSXMBgbLxa9q5v8DUZS_lb-grRlT4kz_QlCwFukd__2yg-agG-i8oiusLqy4IReN3mUQ0QAI5kOfzPARIiPKPKQ1&t=633958669188906250 ajax调用webservice,出现上面的错误,一直不解。网上也没有找到答案,今天终于找到原因。
很简单,在写javascript函数时,如果没有值传入,请什么也不要写。
正确的写法:
错误的写法:
光有理论没有经验等于空谈。
时间戳: Mon, 14 Dec 2009 03:32:55 UTC 消息: Sys.ArgumentTypeException: Object of type 'String' cannot be converted to type 'Function'.
Parameter name: onSuccess
行: 4770
字符: 16
代码: 0
URI: http://localhost:6388/webs/ScriptResource.axd?d=d_Q0Ax-QZTcQtQQuRVnReSXMBgbLxa9q5v8DUZS_lb-grRlT4kz_QlCwFukd__2yg-agG-i8oiusLqy4IReN3mUQ0QAI5kOfzPARIiPKPKQ1&t=633958669188906250 ajax调用webservice,出现上面的错误,一直不解。网上也没有找到答案,今天终于找到原因。
很简单,在写javascript函数时,如果没有值传入,请什么也不要写。
正确的写法:
function btnGetDataTable_onclick() { UserService.ListTestUsers(onSucceeded,onFailed); }
错误的写法:
function btnGetDataTable_onclick() { UserService.ListTestUsers("",onSucceeded,onFailed); }
光有理论没有经验等于空谈。
相关文章推荐
- Json解析异常处理方式(JSONException: Value of type java.lang.String cannot be converted to JSONObject)
- of type java.lang.String cannot be converted to JSONObject: Android
- Value of type java.lang.String cannot be converted to JSONObject
- alue of type java.lang.String cannot be converted to JSONObject
- Json解析异常处理方式(JSONException: Value of type java.lang.String cannot be converted to JSONObject)
- JSONException: Value of type java.lang.String cannot be converted to JSONObject
- new JSONObject(str)无法解析 报错:org.json.JSONException: Value of type java.lang.String cannot be converted to JSONObject
- Value of type java.lang.String cannot be converted to JSONObject 异常
- Json解析异常处理方式(JSONException: Value of type java.lang.String cannot be converted to JSONObject)
- JSONException: Value of type java.lang.String cannot be converted to JSONObject
- Value of type java.lang.String cannot be converted to JSONObject
- org.json.JSONException: Value ok of type java.lang.String cannot be converted to JSONObject: [Caugh
- org.json.JSONException: Value ok of type java.lang.String cannot be converted to JSONObject:
- cannot pass non-trivial object of type 'string' to variadic function
- org.json.JSONException: Value of type java.lang.String cannot be converted to JSON
- Value okhttp3.internal.http.RealResponseBody@49ebb98 of type java.lang.String cannot be converted to
- org.json.JSONException: Value of type java.lang.String cannot be converted to JSONArra
- java.lang.RuntimeException: Value <pre>bool(false) of type java.lang.String cannot be converted to J
- org.json.JSONException: Value of type java.lang.String cannot be converted to JSON
- org.json.JSONException: Value of type java.lang.String cannot be converted to JSONArra