六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 25|回复: 0

JSON.js

[复制链接]

升级  82%

49

主题

49

主题

49

主题

秀才

Rank: 2

积分
173
 楼主| 发表于 2013-1-29 09:04:11 | 显示全部楼层 |阅读模式
转载: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%;">I 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.)
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表