-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON is undefined in IE7 & IE6 #123
Comments
Older browsers like IE7 don't support JSON natively. If you want to support those browsers, there is a JSON parser written in Javascript here: https://github.com/douglascrockford/JSON-js Just make sure you include that in your page before you include the Juggernaut js file or anything else that might require JSON. |
thank you for the feedback. can you please tell what is the recommended way of doing this? is something like this a good idea:
|
I would use json2.js from that repo instead of json.js, and probably just the script tag without the conditional comments.
That way you support every browser that doesn't support JSON natively and not just IE7. If your browser already supports JSON, the code in json2.js gets out of the way and lets the browser handle it, so in a modern browser it won't hurt anything. In fact, if you're using anything that concatenates and minifies your javascript and css assets for you, just add it like any other javascript asset. For example, in Jammit you would add it to your assets.yml and in Rails 3.1+ you would drop it in vendor/assets/javascripts and add an include in your application.js (before or after jquery, shouldn't matter, but definitely before everything else). |
@stevenh512 Cool, bugfix for IE6&IE7, thx~ |
The Hello World app out of box fails in IE7 with the error message, 'JSON' is undefined in line 3340. Screenshot here:
http://img210.imageshack.us/img210/7775/screenshot20120309at600.png
The text was updated successfully, but these errors were encountered: