[jquery] ajax parsererror

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()函数  

posted @ 2015-07-06 18:30  捕蛇者说  阅读(390)  评论(0编辑  收藏  举报