在用javascript替换一个'时是这样:
var a = "test's object.";
a.replace("'","\\'");
如果a变量的值变成: "test''s object."时.
该如何替换成这样: test\'\' object.
?? 谢.
------解决方案--------------------------------------------------------
var a = "test''s object.";
var b = a.replace(/'/g,"\\'");
alert(b);