I\'m getting a \"not well-formed\" error in the error console of Firefox 3.0.7 when the JavaScript on my page loads a text file containing an object in JavaScript Object Not
Kent, I disagree.
The following IS "valid" JSON:
{ a: 3 }
JavaScript object property names do NOT have to be strings.
The problem is one of MIME type, not JSON/JavaScript syntax.
I just solved this very issue by adding json as "text/javascript" to my webserver mime types file:
text/javascript js, json
The "not well-formed" error disappeared. The browser (FireFox) assumed, incorrectly, that the .json file was XML.