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 ...
随机推荐
- BZOJ3132: 上帝造题的七分钟
3132: 上帝造题的七分钟 Time Limit: 20 Sec Memory Limit: 128 MBSubmit: 483 Solved: 222[Submit][Status] Desc ...
- asp.net Post Get提交数据转Model实例
转自:http://blog.csdn.net/daodaowolf/article/details/8990694 此功能是将客户端HTTP协议POST GET方式提交的数据转换为某个Model实例 ...
- (转载)JavaScript中的原型和对象机制
(转载)http://www.cnblogs.com/FlyingCat/archive/2009/09/21/1570656.html 1 对象相关的一些语言特性 1.1 一切皆为对象JavaScr ...
- HDU-2550 百步穿杨
百步穿杨 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submi ...
- RHEL7磁盘分区挂载和格式化
安装大数据平台,每台机器需要挂载10个磁盘,用JBOD模式,操作系统为RHEL7.2. 写了两个脚本,format_disk.sh和mount_disk.sh实现磁盘自动分区格式化以及挂载,修改fst ...
- [LeetCode] 16. 3Sum Closest 解题思路
Given an array S of n integers, find three integers in S such that the sum is closest to a given num ...
- spring boot项目配置文件集合
表 1. Spring Boot 推荐的基础 POM 文件 名称 说明 spring-boot-starter 核心 POM,包含自动配置支持.日志库和对 YAML 配置文件的支持. spring-b ...
- MVC URL处理
需要web.config在system.webServer节点添加 <modules runAllManagedModulesForAllRequests="true"/ ...
- malloc()与calloc差别
Both the malloc() and the calloc() functions are used to allocate dynamic memory. Each operates slig ...
- dig命令 安装
获取容器 dns 信息 需要安装dig 命令 yum install bind-utils