// add escape function to String
String.prototype.escape = function() {
return this.replace(/&/gm, '&').replace(/</gm, '<').replace(/>/gm, '>');
};
Add new function to a prototype in javascript
最新推荐文章于 2025-08-13 21:05:35 发布
// add escape function to String
String.prototype.escape = function() {
return this.replace(/&/gm, '&').replace(/</gm, '<').replace(/>/gm, '>');
};