Jquery使用$.Post方法,本地可以,服务器错误的处理方法...

这次在项目中使用到了

 $.post("/Service/myService.asmx/GetDdMx", { htbh: tx }, function(result) {
alert("1");
});

就是这种方式访问service,看起来很简单也很使用,在本机测试完美通过,可是放到服务器上发现此方法调用没有任何反应,经过多方的查询找到了解决方法,

在web.config中配置支持路径查询,如下:

在web.config的system.web节内添加
<webServices>
<protocols>
<add name="HttpSoap"/>
<add name="HttpPost"/>
<add name="HttpGet"/>
<add name="Documentation"/>
</protocols>
</webServices>
ok,大功告成。

posted @ 2011-10-18 17:16  wangyafei_it  阅读(486)  评论(0编辑  收藏  举报