摘要: (环境:vs2008+jquery1.2.3) 发现.net自带的ajax.net使用webservice输出的是json,其中关键的就是在请求时:Content-Type:application/json;utf-8 所以我们只要在POST时加上一个Content-Type:application/json;utf-8就可以了 $.ajax({ type: "POST", contentType:"application/json;utf-8", url: "/Server/PicLib.asmx/HelloWorld", success: function(msg){ var json = eval('(' + msg + ')'); alert(json.d);} }); var json = eval('(' + msg + ')'); (这个是把返回的字符值转换成json对象,这样子才能够正常的操作json,这里可以用try 阅读全文
posted @ 2008-03-04 11:50 没剑 阅读(27494) 评论(16) 推荐(1) 编辑