In JS, I have a dictionary that I stringify with json (json2):
my_dict = {1:hi you'll, 2:hello};
as_string = JSON.stringify(my_dict);
I need to add this as a value to a form, but the form itself starts out as a string:
var my_form = '<form><input value = '+as_string+'></form>'
my_form is a string because it gets added to the document as DOM (create node, add innerHTML, insert in document)
The issue is that the double quotes get screwed up - there are quotes in my_dict and quotes in my_form. But isn't json supposed to be escaping the double qoutes? Is that not part of what it does? Or do I need to do this? Or is there some other way??