Jquery调用Web Service的一系列问题
实在是困惑啊,发帖求助一下。。。
先粘代码片段吧
web service代码
[WebMethod] public string HelloWorld() { return "HelloWorld"; } [WebMethod(EnableSession=true)] public void AddSchool() { Response.Clear(); Response.Write("要输出的状态码"); Response.End(); }function helloWorld(){ $.ajax({ type:"post", //contentType:"application/x-www-form-urlencoded", url:"/Insert.asmx/HelloWorld", data:"", dataType:"text", success:function(result){ alert(result); } });}function addSchool(){ $.ajax({ type:"post", url:"/Insert.asmx/HelloWorld", data:"", dataType:"text", success:function(result){ alert(result); } });}