From site I get the data that can contain double or single quotes. How to shield them. I send a request for example on https://gdata.youtube.com/feeds / API / VIDEOS / KWLSE-UUOYE? ALT = JSON & amp; v = 2
var name = data.entry.title. $ // = contains the name "Kirkorov need to sing in a mental hospital!" Zhirinovsky! 02.26.2013
innerhtml = '& lt; Input Type = "text" class = "reset" value = "' + name + '" / & gt;'
Answer 1, Authority 100%
str = '"hello" how are you?';
STR = STR.REPLACE (/ "/ G, '& amp; quot;');
HTML = '& LT; Input Type = "text" class = "reset" value = "' + str + '" / & gt;';
Document.Write (HTML);
Answer 2, Authority 50%
If the problem correctly understood, try this:
name = name.replace (/ "/ g, '\\"');