hai
我想在双引号中给出一个javascript变量,任何人都可以帮助我吗?
答案 0 :(得分:3)
您是否尝试在双引号前面使用\来转义字符?
var myVar="this is my text in \"double quotes\"";
答案 1 :(得分:3)
var myString = <?=json_encode('This is a "test".');?>;
答案 2 :(得分:1)
我认为你在谈论字符串连接。如果是这样,就像:
a = "word";
b = "there should be another " + a + " in the middle of this string.";