JavaScript backslash (\) in variables is causing an error

前端 未结 6 2037
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-22 15:19

In Javascript, when I put a backslash in some variables like:

var ttt = \"aa ///\\\\\\\";
var ttt = \"aa ///\\\"; 

Javascript shows an erro

6条回答
  •  自闭症患者
    2020-11-22 16:04

    The jsfiddle link to where i tried out your query http://jsfiddle.net/A8Dnv/1/ its working fine @Imrul as mentioned you are using C# on server side and you dont mind that either: http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.escape.aspx

提交回复
热议问题