Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将字符\作为字符串连接到javascript中的文本?我想用javascript写这个代码行:
\
var x = "$$\" + $("#formul").val() + "$$";
这该怎么做?
转义反斜杠:
var x = "$$\\" + $("#formul").val() + "$$";
您当前遇到的问题是反斜杠是转义字符。它转义了以下"字符,因此您的字符串不会关闭。
"