社区
Web 开发
帖子详情
SyntaxError: JSON.parse: unexpected character at line 6 column 1 of the JSON dat
super_Leon
2015-02-04 02:38:35
如题。。求解。我是springmvc写的 。。就返回了一个对象。。然后就报错了。。
...全文
42537
38
打赏
收藏
SyntaxError: JSON.parse: unexpected character at line 6 column 1 of the JSON dat
如题。。求解。我是springmvc写的 。。就返回了一个对象。。然后就报错了。。
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
38 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
名白
2018-12-11
打赏
举报
回复
坑,解决不分享
PM进阶者
2017-05-15
打赏
举报
回复
坑,解决不分享
HS_红生
2017-04-24
打赏
举报
回复
坑,解决不分享
qq_37676360
2017-04-17
打赏
举报
回复
php服务器解决方案 在输出前加一行代码 ob_end_clean(); 清除utf8的bom头
牛仔花花
2017-03-10
打赏
举报
回复
我遇到了同样的问题,报错信息为
SyntaxError: JSON.parse:unexpected character at line 1 column 1 of the JSON data
是这样解决的:
var json = '{"total":'+eval(num).length+',"rows":'+num+'}';
我之前这里的大括号是复制过来的,竟然是中文的。。。。。。。。后来换成英文的就好了。。。。。。。。。。。。。。。。。。。。。。
jachs
2017-01-02
打赏
举报
回复
坑解决方案呢
更程序中
2016-11-14
打赏
举报
回复
这么坑的人 你就多写点bug吧
cfster
2016-11-04
打赏
举报
回复
大坑,解决不分享
asus10tu
2016-10-26
打赏
举报
回复
坑,解决不分享
tribeWang
2016-04-24
打赏
举报
回复
我也遇到类似问题:
这种错误如果后台拼写传值时和前台接受代码都没问题的话,有可能就是编译的问题了,我查看了我的jsp编码是utf-8格式:
我使用的工具是eclipse,于是发现我的eclipse对jsp的编译格式是ISO Latin-1
将编码格式也改为utf-8格式,就ok了
JustMarker
2016-03-24
打赏
举报
回复
我也遇到了这个问题,原因是我没有传递参数。我写了个<input type="hidden" name="test" value="aaa" />在form里面,就没问题了。可能是easyui的datagrid自带的 queryParams: form2Json('searchform'),要求不能传递空值吧。
it_liang
2016-03-22
打赏
举报
回复
坑,解决不分享
qq_16712975
2016-03-04
打赏
举报
回复
坑,解决不分享, 看他的事例是因为后台直接返回了实体集合,后台应该返回正确的json字符串就可以了
qq_517351411
2016-02-25
打赏
举报
回复
坑,解决不分享
biu~biu~biu~
2016-02-17
打赏
举报
回复
坑,解决不分享
huya-wanghg
2016-02-17
打赏
举报
回复
你看下你前台的的字符串是不是json格式的 键和值多要是双引号 如果不是 在后台要 设置text/html;charset=UTF-8 ,text/html一定要加
qq_25644427
2016-01-26
打赏
举报
回复
坑,解决不分享
改个名字好难
2016-01-06
打赏
举报
回复
坑,解决不分享
久眠深巷
2015-12-10
打赏
举报
回复
坑,解决不分享
lutghj1990
2015-11-26
打赏
举报
回复
坑,解决不分享
加载更多回复(18)
SyntaxError
:
JSON
.
parse
:
unexpected
character
at
line
1
column
1 of the
JSON
dat
a
访问页面的时候出现空白,查看控制台出现
SyntaxError
:
JSON
.
parse
:
unexpected
character
at
line
1
column
1 of the
JSON
dat
a,这应该是
JSON
.
parse
导致的。 修复前的代码 static getItem(key: string): any { ...
jquery解析
json
报错_jQuery解析
JSON
出现
SyntaxError
:
JSON
.
parse
:
unexpected
character
at
line
1
column
2 of the...
jQuery解析
JSON
出现
SyntaxError
:
JSON
.
parse
:
unexpected
character
at
line
1
column
2 of the
JSON
dat
a 0 470lisa2019/6/25 16:35:13//错误代码[pre]function showGoodsType(){$.ajax({url:"/sysCode/...
SyntaxError
:
JSON
.
parse
:
unexpected
character
at
line
1
column
1 of the
JSON
dat
a
前端发起 ajax,后端 php 返回 ...
SyntaxError
:
JSON
.
parse
:
unexpected
character
at
line
1
column
1 of the
JSON
dat
a 解决方案: 在php 服务端,输出前加一行代码: ob_end_clean();清除 utf8 的 bom 头 ...
SyntaxError
:
JSON
.
parse
:
unexpected
end of
dat
a at
line
1
column
1048577 of the
JSON
dat
a
SyntaxError
:
JSON
.
parse
:
unexpected
end of
dat
a at
line
1
column
1048577 of the
JSON
dat
a 异常场景 客服群问题反馈某数据存在但不展示 查询数据库,数据确实存在且状态正常 火狐浏览器 FireBug 查看接口响应...
报错
SyntaxError
:
JSON
.
parse
:
unexpected
character
at
line
1
column
2 of the
JSON
dat
a
console.log("
JSON
.stringify(
JSON
.
parse
(a)) -> " +
JSON
.stringify(
JSON
.
parse
(a))); 原因
JSON
.
parse
()方法是将一个
JSON
格式的字符串转换成JavaScript对象,但是在上述代码中已经是一个...
Web 开发
81,122
社区成员
341,744
社区内容
发帖
与我相关
我的任务
Web 开发
Java Web 开发
复制链接
扫一扫
分享
社区描述
Java Web 开发
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章