[jquery] ajax parsererror
2015-07-06 18:30
585 查看
http://stackoverflow.com/questions/5061310/jquery-returning-parsererror-for-ajax-request
方法一:
直接去掉 dataType : 'json' 属性
方法二:
意思是说,如果你返回的不是真正的json格式的数据,那么就会提示parsererror。
因此,解决办法就很简单了,把返回的结果转换成Json格式就好了。比如php就可以使用 json_encode()函数
方法一:
直接去掉 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 调试
- JQUERY解析XML
- 在chrome console加入jquery库
- jquery 排序table的列
- jQuery ajax - ajax() 方法
- jquery easyui treegrid 实例
- jquery的几种ajax方式对比
- cleanzone模板-表格插件jquery.datatables
- jquery的ajax和getJson跨域获取json数据
- jQuery工具函数
- jQuery入门:用包装集工作(Working with Selections)
- jquery的ajax提交form表单
- jquery cookie用法(获取cookie值,删除cookie)
- jQuery原型属性constructor,selector,length,jquery和原型方法size,get,toArray源码分析
- 解决jquery新加入的元素没有绑定事件问题
- jQuery中的ajax处理json三种方法
- jQuery的笔记
- C#后台拼接jquery 中的超链接并绑定事件
- jquery ajax jsonp 跨域实现
- 缓冲加载图片的 jQuery 插件 lazyload.js 使用方法详解