摘要: 1、var strJson = '{"a":12, "b":5}'; function parseJson(str) { return new Function("return "+ str )(); //为什么可以呢 /* new Function("x", "y", "return ... 阅读全文
posted @ 2015-04-01 17:59 醉酒笑红尘 阅读(81) 评论(0) 推荐(0)
摘要: 转载自:http://blog.snsgou.com/post-13.html在JS中将JSON的字符串解析成JSON数据格式,一般有两种方式:1.一种为使用eval()函数。2. 使用Function对象来进行返回解析。第一种解析方式:使用eval函数来解析,并且使用jQuery的each方法来遍... 阅读全文
posted @ 2015-04-01 15:54 醉酒笑红尘 阅读(260) 评论(0) 推荐(0)
摘要: 转载自:https://www.imququ.com/post/mobile_web_and_js_timer.html在之前博客中,我曾经写过「PC 上的 Firefox、Chrome 和 Safari 等浏览器,都会自动把未激活页面中的 JavaScript 定时器(setTimeout、set... 阅读全文
posted @ 2015-04-01 09:13 醉酒笑红尘 阅读(217) 评论(0) 推荐(0)