Skip to content

Instantly share code, notes, and snippets.

@cheeaun
Created June 22, 2009 10:37
Show Gist options
  • Save cheeaun/133914 to your computer and use it in GitHub Desktop.
Save cheeaun/133914 to your computer and use it in GitHub Desktop.
JSON parsing method, uses eval() for old browsers, JSON.parse for new ones.
var evalJSON = function(string){
return (window.JSON && JSON.parse) ? JSON.parse(string) : eval('(' + string + ')');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment