How to concat character \
as a string to a text in javascript?
I want to write this code line in javascript:
var x = "$$\" + $("#formul").val() + "$$";
How to do this?
How to concat character \
as a string to a text in javascript?
I want to write this code line in javascript:
var x = "$$\" + $("#formul").val() + "$$";
How to do this?
Share Improve this question asked Apr 5, 2013 at 8:38 Hamid RezaHamid Reza 2,97510 gold badges52 silver badges79 bronze badges1 Answer
Reset to default 5Escape the backslash:
var x = "$$\\" + $("#formul").val() + "$$";
The problem you have currently is that the backslash is the escape character. It escapes the following "
character so your string doesn't close.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745359436a4624292.html
评论列表(0条)