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

$.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();


忽然笑
浏览 535回答 2
2回答

元芳怎么了

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

噜噜哒

你在ajax最后加一句error:function(result)            {              alert(result);            }然后加断点看看,result有什么信息
打开App,查看更多内容
随时随地看视频慕课网APP