I'm having some trouble getting JSON to store some Javascript as a string value.
{
"code": "function test(){alert('coreg.js has been loaded'); if (jQuery) { alert('We have jQuery!'); } else { alert('We don\'t have jQuery...'); } }"
}
When I validate this using www.jsonlint.com it says I've got a syntax error (unexpected TINVALID at line 2) but I can't for the life of me see what it is. The Javascript is all entirely valid, all I did was take my function and put double quotes outside it.
I'm really confused! Does anyone know what I'm doing wrong?