jQuery提示parsererror错误解决办法

jquery来处理ajax,用到了json。但是很诧异,jquery的ajax回调时一直调用了error函数(一直提示parsererror异常),success函数一次没执行过

1 $.ajax({
2 type:'POST',
3 url:'/go.php?p=chat.chatCenter&a=send',
4 dataType:'json',
5 data:'style='+Tstyle+'&content='+content,
6 success:function(data){$.chatCenter.sendEnd(data);},
7 error:function(data,t){alert("系统异常["+t+"]");$.chatCenter.sendEnd();}
8 });

最后发现是json的数据格式出错了!数据格式必须为双引号

原文地址:https://www.cnblogs.com/tl542475736/p/3912724.html