window.open被浏览器拦截后的自定义提示效果代码
2007-11-19 00:00
621 查看
现在越来越多的浏览器有拦截弹出窗口的功能。广告弹出来给拦掉了就无所谓,要是客户在付款时给拦掉了可就不能乱算了。
Gmail的“哎呀”算是经典,可是,前天心云给出了更帅的提示=。= 记得打开浏览器拦截后 测试一下,在线阅读器里不知道代码会不会给过滤。。代码在下边,其实没什么技术含量滴。挖哈哈。。。
=。= 重写window.open写了两天都没有想到更好的办法,参数要一个一个加,第四个参数,似乎只是为了不被back回去,例如:
Optional. Boolean that specifies whether the sURL creates a new entry or replaces the current entry in the window's history list. This parameter only takes effect if the sURL is loaded into the same window.
true sURL replaces the current document in the history list
false sURL creates a new entry in the history list.
Gmail的“哎呀”算是经典,可是,前天心云给出了更帅的提示=。= 记得打开浏览器拦截后 测试一下,在线阅读器里不知道代码会不会给过滤。。代码在下边,其实没什么技术含量滴。挖哈哈。。。
window._open=window.open; window.open=function(sURL,sName,sFeatures,bReplace){ if(sName==undefined){sName="_blank"}; if(sFeatures==undefined){sFeatures=""}; if(bReplace==undefined){bReplace=false}; var win=window._open(sURL,sName,sFeatures,bReplace); if(!win){ alert('天啦!你的机器上竟然有软件拦截弹出窗口耶,好讨厌哦,人家不来了啦!快去掉嘛~~555~'); return false; } return true; }
=。= 重写window.open写了两天都没有想到更好的办法,参数要一个一个加,第四个参数,似乎只是为了不被back回去,例如:
window.open("a.html","a"); window.open("b.html","a","",true);打开的b.html是没有后退可以按滴,MSDN有说明 。
Optional. Boolean that specifies whether the sURL creates a new entry or replaces the current entry in the window's history list. This parameter only takes effect if the sURL is loaded into the same window.
true sURL replaces the current document in the history list
false sURL creates a new entry in the history list.
相关文章推荐
- window.open被浏览器拦截后的自定义提示效果代码
- window.open()被浏览器拦截的问题
- window.open被浏览器拦截的解决方案
- 浏览器拦截window.open的解决方案
- window.open不被拦截的实现代码
- window.open打开新窗口被浏览器拦截的处理方法
- 如何防止window.open打开的弹出窗口被浏览器拦截
- window.open被浏览器拦截的解决方案
- window.open关于浏览器拦截问题分析及解决方法
- window.open不被拦截的实现代码
- window.open被浏览器拦截的解决方案
- window.showModalDialog浏览器不支持后使用window.open代码问题处理方法
- 解决window.open被浏览器拦截的问题
- window.open浏览器弹出新窗口被拦截—原因分析和解决方案
- 解决弹出的窗口window.open会被浏览器阻止的问题(自定义open方法)
- window.open 浏览器拦截解决
- window.open被浏览器拦截的解决方案
- 解决window.open浏览器拦截的办法
- 在Ajax回调方法中通过window.open方法下载文件被浏览器拦截的解决方法
- window.open被浏览器拦截