常用的js函数处理
/**
*Returnastringwith&,<and>replacedwiththeirentities
*/
functionescapeHtml(original){
returnoriginal.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,''');
};
/**
*ReplacecommonXMLentitieswithcharacters
*/
functionunescapeHtml(original){
returnoriginal.replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,'&');
};
/*
*Trim()function
*/
String.prototype.Trim=function(){
returnthis.replace(/(^\s*)|(\s*$)/g,"");
}
String.prototype.LTrim=function(){
returnthis.replace(/(^\s*)/g,"");
}
String.prototype.RTrim=function(){
returnthis.replace(/(\s*$)/g,"");
}
相关推荐
<object type="application/x-shockwave-flash" style="outline:none;" data="http://cdn.abowman.com/widg