js - SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data jquery-1.9.1.min.js:3:4315
FF中时不时报这个错, 就近段做项目来看, 一般是我通过 jquery获取form中的参数(或直接获取参数,并通过ajax进行异步请求的时候,如果有错,就抱该错误!
而对应的, 如果在 Google chrome中, 则会报: Uncaught SyntaxError: Unexpected token <
我觉得Google chrome的这个错, 有点不太准确.
虽然题目中的错误, 很泛, 但是就近段做项目来说, 大致就是这样.
其实可以分很多种类型的
1)"错误请求参数":包括:在struts2 的Action中的接受或请求参数不对应, 或没有相应的 getter/setter方法.等.
2)返回数据错误:当在java中的代码发生错误时, 也FF也会报该错, 例如通过List.add(Monitor)时, 会调用Monitor中的hashCode方法, 如果字段或属性的值为空.
建议: java代码尽量优先通过 junit 进行单元测试.
js - SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data jquery-1.9.1.min.js:3:4315的更多相关文章
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data错误的解决
记录个报错: 问题描述: 经过服务器生成图片返到前台时,在火狐浏览器中下载图片或打开图片时报错:SyntaxError: JSON.parse: unexpected character at lin ...
- jQuery解析JSON出现SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data
SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data 我在使用$.parseJSON解析后 ...
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
在用php返回json数据的时候如果出现这种错误,先检查一下php中是否有使用var_dump()函数 这个函数会在页面输出测试变量的结构,浏览器会将这个当做json数据,所以就报错了....
- SyntaxError: JSON.parse: bad control character in string literal at line 1 column 16 of the JSON data
JSON.parse转化Json字符串时出现:SyntaxError: JSON.parse: bad control character in string literal at line 1 co ...
- SyntaxError: unexpected character after line continuation character
SyntaxError: unexpected character after line continuation character 待解决问题:在运行.py文件时报错SyntaxError: un ...
- json.loads(s) returns error message like this: ValueError: Invalid control character at: line 1 column 33 (char 33)
json.loads(s) returns error message like this: ValueError: Invalid control character at: line 1 colu ...
- SSH框架-unexpected token: * near line 1, column 8 [select * from tb_chaper where course_id = 2];报错解决方法
SSH项目,访问jsp页面出现报错,控制台显示报错信息: org.springframework.orm.hibernate3.HibernateQueryException: unexpected ...
- Parse Fatal Error at line 41 column 24: 元素类型 "url-pattern" 必须由匹配的结束标记 "</url-pattern>" 终止
1.错误描述 严重: Parse Fatal Error at line 41 column 24: 元素类型 "url-pattern" 必须由匹配的结束标记 "< ...
- json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
1.json模块常用的四个函数 import json json.load() # 将一个存储在文件中的json对象(str)转化为相对应的python对象 json.loads() # 将一个jso ...
随机推荐
- POJ_2914_Minimum_Cut_(Stoer_Wagner)
描述 http://poj.org/problem?id=2914 求无向图中最小割. Minimum Cut Time Limit: 10000MS Memory Limit: 65536K T ...
- SQL中and与or优先级比较
刚刚在项目中遇到这样一个问题,SQL语句如下: select * from LOAN_BACK_LIBRARY where LIBRARY_ID=1 or LIB_ID=1 and STATUS=3 ...
- Intersoft Mobile Studio 2013 R1 SP1 Crack
Intersoft Mobile Studio 2013 R1 SP1 (iOS, Android & WinR) Leave a comment tweet inShare ...
- MFC如何获取编辑框中输入的内容
1.GetDlgItemText() 2.先用 GetDlgItem(编辑框的ID)获取指向编辑框的指针.再用GetWindowText函数将获取内容保存至指定的字符数组里. 3.使用 GetDlgI ...
- MyEclipe 配置 ivy 插件
在 MyEclipse 装插件绝对不是技术的问题.只要你有足够的耐心和时间. 经过两次试验,在 MyEclipse 配置插件大概流程如下. 配置ivy: 1.打开配置中心 2.选择[Sof ...
- opencv 中文文档地址
http://www.opencv.org.cn/opencvdoc/2.3.2/html/doc/tutorials/tutorials.html
- Yii - 验证和授权(Authentication and Authorization)
1. 定义身份类 (Defining Identity Class) 为了验证一个用户,我们定义一个有验证逻辑的身份类.这个身份类实现[IUserIdentity] 接口.不同的类可能实现不同的验证 ...
- Unicode与 utf8的互相转换
<?php function unicode_encode($name) { $name = iconv('UTF-8', 'UCS-2', $name); $len = strlen($nam ...
- 新安装XAMPP,phpMyAdmin错误:#1045 - Access denied for user 'root'@'localhost' (using password: NO)
错误如下: 打开D:\Program Files\xampp\phpMyAdmin(你的xampp的安装目录下的phpMyAdmin目录)目录下的config.inc.php文件 将 改为 然后,错误 ...
- eclipse中建立tomcat容器
步骤 1. new - orther - server 出现下图,选择tomcat版本, 2. 选择已有的web项目至tomcat容器中,如果尚未建立,可不选. 3. 点击完成后,就会发现一个新建项 ...