Skip to content

Instantly share code, notes, and snippets.

@lsauer
Created September 28, 2011 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lsauer/1247072 to your computer and use it in GitHub Desktop.
Save lsauer/1247072 to your computer and use it in GitHub Desktop.
jquery doesn't parse JSON with comments
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
$.getJSON('b8irg1.json', function(data) { console.log(data);});
will only contain an responseText property but not the JSON.parse'd data appended if the JSON file contains comments of the kind '// or /*...*/'
Note tried with jquery 1.6.4
@chuckhacker
Copy link

Any updates? It would be helpful to include comments in my JSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment