[removed] Replace backslashes with double backslashes

后端 未结 1 1495
被撕碎了的回忆
被撕碎了的回忆 2020-12-12 00:15

I\'m currently having the problem mentioned in the title and I\'m somehow not finding a way to properly replace backsashes with double backslashes, so that I can properly gi

相关标签:
1条回答
  • 2020-12-12 01:03

    WSParameters.replace(/\\/g, "\\\\"); should do it, and in FF18 as well. Notice that if you use JSON.stringify, this is done automatically. Also watch out that many console outputs (Firebug etc) do surround string contents with quotes, but do not escape them.

    0 讨论(0)
提交回复
热议问题