
javasc
ISaiSai
这个作者很懒,什么都没留下…
展开
-
window.close 兼容性
window.close 在被 window.open 的页面上使用的时候没有问题当在浏览器敲击地址的页面上需要使用如下标准代码:var userAgent = navigator.userAgent;if (userAgent.indexOf("Firefox") != -1 || userAgent.indexOf("Chrome") !=-1) { window.location.hr原创 2016-04-11 15:30:57 · 2267 阅读 · 0 评论 -
SyntaxError: Unexpected number in JSON at position 1
SyntaxError: Unexpected number in JSON at position 1javascript JSON序列表,key 是int类型的时候,出错处理方法,使用正则表达式,将int类型的key 替换成字符串var a ="{2:\"全天\",7:\"测试\",8:\"1天\",9:12,10:14}";var x = a.replace(/(\d+):/g,"...原创 2019-03-12 14:35:20 · 13097 阅读 · 0 评论