My problem is html content not being parsed with JSON.parse
.
I am getting input from a content editable div.
var content = $("#contentInput").html();
I am sending it to server after
JSON.stringify
var dataToServer= JSON.stringify(content); //sending an object
The same content I am getting from server, and I attempting to parse it.;
var dataFromServer = JSON.parse(content);
Here my problem raises parser throwing error. content of html data receiving as it is.
I was tried eval
but after reading the some articles I was withdrawn my decision.
How to resolve the problem.
JSON.stringify
ing a string? – Musa Oct 5 '12 at 5:55JSON
at all! – Jack Oct 5 '12 at 6:27