为了账号安全,请及时绑定邮箱和手机立即绑定

jquery访问aspx 文件 得不到返回的数据?

jquery访问aspx 文件 得不到返回的数据?

忽然笑 2018-11-21 09:21:29
$.ajax({url: locator ? locator : '../AjaxService.asmx/' + method,type: 'post',dataType: 'json',contentType: 'application/json',data: strParm,success: function (data) {if (data) {【1】 callback(data.d);}}});访问是可以正常访问到aspx文件 但返回的时候就是接受不到,在【1】出大了断点,但是跑不进去aspx文件代码如下所示 Response.ContentType = "application/json";                    Response.Charset = "utf-8";                    Response.Write(“{'data':'Success'}”);                    Response.End();
查看完整描述

2 回答

?
元芳怎么了

TA贡献1798条经验 获得超7个赞

你可以先不要进if 在if 上面alert(data)看能弹出来什么

查看完整回答
反对 回复 2018-11-25
?
噜噜哒

TA贡献1784条经验 获得超7个赞

你在ajax最后加一句error:function(result)

            {

              alert(result);

            }

然后加断点看看,result有什么信息


查看完整回答
反对 回复 2018-11-25
  • 2 回答
  • 0 关注
  • 534 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信