admin管理员组文章数量:1341419
I have some JS that runs fine in FF and IE but in Chrome I see the following error:
uncaught exception ReferenceError: JSON is not defined
I presume I need to include something but I'm not sure what. Help? Also, any clue why this might work on IE/FF but not Chrome?
Btw, I'm using JSON.stringify() in my script.
UPDATE: JSON.stringify
is now available in chrome (couldn't find when it was introduced).
I have some JS that runs fine in FF and IE but in Chrome I see the following error:
uncaught exception ReferenceError: JSON is not defined
I presume I need to include something but I'm not sure what. Help? Also, any clue why this might work on IE/FF but not Chrome?
Btw, I'm using JSON.stringify() in my script.
UPDATE: JSON.stringify
is now available in chrome (couldn't find when it was introduced).
1 Answer
Reset to default 9The JSON object is not yet part of the standard IIRC, but is expected to be soon. In the meantime, browsers are free to implement it at will, and that's probably what you are seeing here.
Your best bet is to get a separate library that does the same thing and use it for the meantime until native implementations are more widespread. You can find a very good one here (Link at the bottom).
本文标签: javascriptJSON is not definedchromeStack Overflow
版权声明:本文标题:javascript - JSON is not defined, Chrome - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743668769a2519178.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论