.replace(/\'/g, "\\'")    ->  ' 替换成  \'

.replace(/\'/g,"")  ->  ' 替换成 "  

.replace(/\"/g, "\\\"")  ->  " 替换成\"   

注:适用于 onclick='Test("数字双音\"")'  这种写法

.replace(/\"/g, """)  ->" 替换成 " 

注:适用于onclick="Test('数字双音&quot')"  建议写法

.replace(/</g, "\\\<") ->  < 替换成\<

.replace(/>/g,"\\\>")  ->  > 替换成\>

相关文章:

  • 2022-01-04
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-09
  • 2022-12-23
相关资源
相似解决方案