How to concat special characters as sting to a text in javascript? - Stack Overflow

How to concat characteras a string to a text in javascript?I want to write this code line in javasc

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 badges
Add a ment  | 

1 Answer 1

Reset to default 5

Escape 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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信