String.prototype.replaceAll = function(reallyDo, replaceWith, ignoreCase) {
if (!RegExp.prototype.isPrototypeOf(reallyDo)) {
return this.replace(new RegExp(reallyDo, (ignoreCase ? "gi": "g")), replaceWith);
} else {
return this.replace(reallyDo, replaceWith);
}
};
引用:data.activityName = $("#name",MileStoneDialog.getDialog()).val().replaceAll("<","<").replaceAll(">",">");
详情见:http://fuleonardo.iteye.com/blog/339749