后台代码: [WebMethod] publicstaticstringSayHello() { //一定是要静态方法,并且声明为[WebMethod]前端才可以访问return"HelloAjax
error:function(XMLHttpRequest,textStatus,errorThrown){alert(errorThrown);}}); 下面为asmx的方法代码 代码如下: [WebMethod