citi21558541 发表于 2013-1-29 09:04:11

JSON.js

转载:http://blog.csdn.net/hingwu/archive/2007/04/29/1591624.aspx
Error:too much recursion收藏

<div class="blogstory"><script type="text/javascript"><!-- document.body.oncopy = function () {if (window.clipboardData) {setTimeout(function () {var text = clipboardData.getData("text");if (text && text.length > 300) {text = text + "\r\n\n本文来自CSDN博客,转载请标明出处:" + location.href;clipboardData.setData("text", text);}}, 100);}}// --></script><script type="text/javascript"><!-- function StorePage() { d = document; t = d.selection ? (d.selection.type != 'None' ? d.selection.createRange().text : '') : (d.getSelection ? d.getSelection() : ''); void (keyit = window.open('http://www.365key.com/storeit.aspx?t=' + escape(d.title) + '&u=' + escape(d.location.href) + '&c=' + escape(t), 'keyit', 'scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes')); keyit.focus(); }// --></script>        关于JSON的好处就不说了,反正我是喜欢上它了,也开始在自己的项目中使用JSON,前两天刚到官网下载了最新的json.js文件,结果我的页面一打开就报错:too much recursion!在IE和FF中都是如此,刚开始以为是自己的代码写错了,后来仔细看看才发现应该是json.js这个文件有问题,于是照例Google,找到不少资料,不少开发者在使用最新版的json.js文件时都出现了这个问题。
<div style="padding: 4px 5.4pt; width: 95%;">http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gifI started off by using the JSON js code, however this code is unusable for 1 major reason - it adds a method to array's/objects, resulting in the fact that foreach() always returns an additional member. (breaking almost all the existing javascript code!) - I also ran into problems with recursion in firefox (but I think thats due to me forgetting to add the String.prototype method.)
页: [1]
查看完整版本: JSON.js