js 补充方法

 

//replaceAll方法  replace 只能替换一个
String.prototype.replaceAll = function(s1,s2) { 
    return this.replace(new RegExp(s1,"gm"),s2); 
}

//IE 下控制浏览器文字不能被选中
style="-moz-user-select:none;" onselectstart="javascript:return false;"
 

 

你可能感兴趣的:(js)