uncaught syntaxerror unexpected token U JSON
uncaught syntaxerror unexpected token U JSON
The parameter for the JSON.parse may be returning nothing (i.e. the value given for the JSON.parse is undefined
)!
It happened to me while I was parsing the Compiled solidity code from an xyz.sol file.
import web3 from './web3';
import xyz from './build/xyz.json';
const i = new web3.eth.Contract(
JSON.parse(xyz.interface),
'0x99Fd6eFd4257645a34093E657f69150FEFf7CdF5'
);
export default i;
which was misspelled as
JSON.parse(xyz.intereface)
which was returning nothing!
看了一下本地的代码,传递给函数的参数是$('#ctl00_cphMain_ucProfile_Avatar_hffulList').val(),
在Chrome的console的控制台运行,发现返回结果是undefined,
在html里面搜索了一下ctl00_cphMain_ucProfile_Avatar_hffulList,发现这个元素不存在
uncaught syntaxerror unexpected token U JSON的更多相关文章
- JSON.parse()——Uncaught SyntaxError: Unexpected token \ in JSON at position 1
背景:项目安全处理方面之一 ——对特殊字符进行编解码(后端编码,前端解码) 特殊字符: " %22 \ %5C / %2F & %26 % %25 ' ...
- Uncaught SyntaxError: Unexpected token ' in JSON at position 1
听说js是一样很BT的语言,今天真是有点领教到了. 用python3.6+django2.0开发网站时,遇到了一个坑中之坑! 在异步数据提交Ajax的运用中,不免在回调函数中使用到JSON.parse ...
- 关于Uncaught SyntaxError: Unexpected token o in JSON at position 1,chrome持续报错的相关解析
今天跟大家分享我前两天遇见的一个BUG,说出来很难受,因为这个BUG花了我一个多小时去找原因,后来莫名其妙的故障消失了,强迫症犯了的我,居然花了2个多小时去故意再制造这个BUG,只想弄明白WHY??? ...
- json格式字符串用Uncaught SyntaxError: Unexpected token ' Uncaught SyntaxError: Unexpected number
Unexpected number(index)的错误用的json字符串如 var jsonStr = "{1:'北京note备注信息',2:'上海note备注信息',3:'广东note备注 ...
- Atitit Uncaught (in promise) SyntaxError Unexpected token < in JSON at position 0
Atitit Uncaught (in promise) SyntaxError Unexpected token < in JSON at position 0 Uncaught (in ...
- VM603:1 Uncaught SyntaxError: Unexpected token o in JSON at position 1
再用JQuery解析json的时候出现了这样一个问题 VM603: Uncaught SyntaxError: Unexpected token o 通过查阅资料发现,是由于解析json文件的时候解析 ...
- SyntaxError: Unexpected token ' in JSON at position 2
js中字符串转json对象时报错: Uncaught SyntaxError: Unexpected token s in JSON at position 2 解决方法: js中获取jsp的返回值 ...
- jquery使用ajax报错[Uncaught SyntaxError: Unexpected token :]
$.post('/ajax/validate.do',{"id": id},function(ret){ //ret }); 返回值明明是json,格式也是正确的,却解析不成功,在 ...
- Uncaught SyntaxError: Unexpected token : 开发遇到的跨域问题
先描述一下,这个问题,是如何遇到的 在ajax调用远程服务的时候,报了一个Origin xxxxxx is not allowed by Access-Control-Allow-Origin 的错误 ...
随机推荐
- 使用了框架iframe的页面如何跳出框架
"window.location.href"."location.href"是本页面跳转. "parent.location.href" 是 ...
- 正则表达式、原始字符串及re
正则表达式.原始字符串及re re是python中的一个文本解析工具,常用的方法有: 来源:https://www.ibm.com/developerworks/cn/opensource/os-cn ...
- 使用Servlet实现验证码
没有验证码带来的问题 对特定用户不断登录破解密码. 对某个网站创建账户. 对某个网站提交垃圾数据. 对某个网站刷票. 通过验证码由用户肉眼识别其中的验证码信息,从而区分用户是人还是计算机. 定义: ...
- linux php环境搭建
1.我使用的是一键安装包 下载地址: https://lnmp.org/download.html2.我下载的是完整包 http://soft.vpser.net/lnmp/lnmp1.4-full. ...
- 枚举java语言中的修饰符组合
package model; /*22:37 2019/7/20*/ /* top class的修饰符组合 abstract final public 2 * 2 * 2 warning: abstr ...
- 异步分布式队列Celery
异步分布式队列Celery 转载地址 Celery 是什么? 官网 Celery 是一个由 Python 编写的简单.灵活.可靠的用来处理大量信息的分布式系统,它同时提供操作和维护分布式系统所需的工具 ...
- lnmp 环境搭建后,pathinfo 模式支持的配制。
ThinkPHP的四种URL模式:0(普通模式);1(PATHINFO模式);2(REWRITE模式);3(兼容模式) nginx需要PATHINFO模式,但需要更改nginx配置文件让其支持PATH ...
- AIX中文件系统管理
1.文件系统类型 AIX主要支持的文件系统有: JFS(Journaled File Systems) 日志型文件系统 JFS2(Enhanced Journaled File S ...
- 【转】Linux iptables 详解
转自:https://www.cnblogs.com/qwertwwwe/p/9452370.html 最近搭一个框架需要用到iptables做映射,学习了下iptables的原理,总结下方便以后查~ ...
- Codeforces Round #605 (Div. 3) 比赛总结
比赛情况 2h才刀了A,B,C,D.E题的套路做的少,不过ygt大佬给我讲完思路后赛后2min就AC了这题. 比赛总结 比赛时不用担心"时间短,要做多快",这样会匆匆忙忙,反而会做 ...