---
title: "js 补充方法"
author: "winder_sety"
date: "2012-11-08T09:28:25Z"
tags: []
categories: ["Web前端"]
slug: "js"
draft: false
lastmod: "2014-05-05T17:17:50Z"
id: 1719992
url: "https://winder-sety.iteye.com/blog/1719992"
---

```
//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;"
 
```