且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

调用简单的Web服务(.asmx文件)使用JSON AJAX和JQuery的 - 解析错误

更新时间:2023-09-13 17:51:40

您code看起来好有一个可疑的地方:网​​址。您应该替换网​​址来像TAPI.asmx / simplestMethod/ D2 /TAPI.asmx/simplestMethod

Your code looks like good with one suspected place: url. You should replace url to something like "TAPI.asmx/simplestMethod" or "/d2/TAPI.asmx/simplestMethod".

此外,如果你想学习到如何调用Web方法与参数或从Web方法看看返回更复杂的数据http://***.com/questions/2737525/how-do-i-build-a-json-object-to-send-to-an-ajax-webservice/2738086#2738086和http://***.com/questions/3445859/asmx-web-service-json-javascript-jquery/3446517#3446517, http://***.com/questions/2670147/can-i-return-json-from-an-asmx-web-service-if-the-contenttype-is-not-json/2671583#2671583.如何去code错误消息从异常Web方法里面看到http://***.com/questions/3635133/get-xhr-object-in-vb-net-while-ajax-calling-fails/3644248#3644248.

Moreover if you want study to how to call web method with parameters or return more complex data from the web method look at http://***.com/questions/2737525/how-do-i-build-a-json-object-to-send-to-an-ajax-webservice/2738086#2738086 and http://***.com/questions/3445859/asmx-web-service-json-javascript-jquery/3446517#3446517, http://***.com/questions/2670147/can-i-return-json-from-an-asmx-web-service-if-the-contenttype-is-not-json/2671583#2671583. How to decode error messages from the exception inside of web method see http://***.com/questions/3635133/get-xhr-object-in-vb-net-while-ajax-calling-fails/3644248#3644248.