While using Firefox 23.0.1, I encountered the following code snippet:
var foo = '{ "success": false, "errtype": "barf", "message": "my message\n"}';
var what = JSON.parse(foo);
console.log(what);
Upon running this code in the Firebug Javascript window or checking the console log on my website, I received a SyntaxError: JSON.parse: bad control character in string literal.
Despite appearing to be valid JSON according to http://www.json.org/ and passing validation at http://jsonlint.com/, the issue persisted.
Removing the "\n" from the end of "my message" resolved the problem in Firefox, although I have not tested it on other browsers yet.
Could this potentially indicate a bug within Firefox?