首页 > Web开发 > 详细

[jquery] ajax parsererror

时间:2015-07-06 19:32:00      阅读:275      评论:0      收藏:0      [点我收藏+]

http://stackoverflow.com/questions/5061310/jquery-returning-parsererror-for-ajax-request

方法一:

直接去掉 dataType : ‘json‘ 属性

方法二:

The reason why this parserror message occurs is that when you simply return a string or another value, it is not really Json, so the parser fails when parsing it.

意思是说,如果你返回的不是真正的json格式的数据,那么就会提示parsererror。

因此,解决办法就很简单了,把返回的结果转换成Json格式就好了。比如php就可以使用 json_encode()函数  

[jquery] ajax parsererror

原文:http://www.cnblogs.com/bushe/p/4625070.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!