I have an input hidden element, the value of which contains JSON of an HTML encoded string. Something like
{"QuestionInstruction":"<snippet lang="java"> public class Test() {\n\n}</snippet>","QuestionDescription":"it this correct?","Choices":["True","False"] }
and when I do
var text = document.getElementById('inputId').value,
the " automatically gets converted to "". The value of text
comes as -
{"QuestionInstruction":"<snippet lang="java"> public class Test() {\n\n}</snippet>","QuestionDescription":"it this correct?","Choices":["True","False"] }
So, then JSON parsing fails. :(
I am using FF9.