I am building an auto-save feature for my TinyMCE editor.
With jQuery, I have saved the editor's content to my database and now want to load the content back in to the editor. I am having troubles with the quotes (") in the HTML coming from the DB.
My code:
var content = "" // Classic ASP variable containing HTML from DB
tinyMCE.activeEditor.setContent(content);
Example output:
var content = "
Oh yes, from Churchill, the dog.
"tinyMCE.activeEditor.setContent(content);
In the variable, "content", there are double quotes in the style tag which is causing a JS error. How do I get around this? Do I replace quotes with single quotes or do I use an escape or encode function? Please help.