第一次发现javascript中replace() 方法如果直接用str.replace("-","!") 只会替换第一个匹配的字符.
引用内容
replace()
The replace() method returns the string that results when you replace text matching its first argument
(a regular expression) with the text of the second argument (a string).
If the g (global) flag is not set in the regular expression declaration, this method replaces only the first
occurrence of the pattern. For example,
var s = "Hello. Regexps are fun.";s = s.replace(/\./, "!"); // replace first period with an exclamation pointalert(s);
The replace() method returns the string that results when you replace text matching its first argument
(a regular expression) with the text of the second argument (a string).
If the g (global) flag is not set in the regular expression declaration, this method replaces only the first
occurrence of the pattern. For example,
var s = "Hello. Regexps are fun.";s = s.replace(/\./, "!"); // replace first period with an exclamation pointalert(s);
一直用ie为准做网页,今天到火狐官方网站下了个没有google插件的安装了(特别讨厌插件,而国内几乎下载不到没有google插件的火狐浏览器!)
打开一看,哇哈,终于来了,ff好多不兼容的问题来了。随便点击了下不兼容的问题就有上十个了。一个个慢慢解决,慢慢搜索。。。。。。。先把几个简单的整理分享一下。
1.最简单的鼠标移过手变型的css要改了 cursor:pointer;/*ff不支持cursor:hand*/ dw8下面自动出来的也没有hand这个属性了,标准的是pointer
2.ff不支持滤镜 最常见的半透明不支持。
filter: Alpha(Opacity=50); /* for IE */
打开一看,哇哈,终于来了,ff好多不兼容的问题来了。随便点击了下不兼容的问题就有上十个了。一个个慢慢解决,慢慢搜索。。。。。。。先把几个简单的整理分享一下。
1.最简单的鼠标移过手变型的css要改了 cursor:pointer;/*ff不支持cursor:hand*/ dw8下面自动出来的也没有hand这个属性了,标准的是pointer
2.ff不支持滤镜 最常见的半透明不支持。
filter: Alpha(Opacity=50); /* for IE */
复制内容到剪贴板 程序代码
<script>
function openpopup(){
window.open("http://www.xxx.com/","","width=300,height=300,scroolbars=no") //自己修改弹出窗口
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
function openpopup(){
window.open("http://www.xxx.com/","","width=300,height=300,scroolbars=no") //自己修改弹出窗口
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
Tags: Cookie