|
Gmail的“哎呀”算是經(jīng)典,可是,前天心云給出了更帥的提示=。= 記得打開(kāi)瀏覽器攔截后 測(cè)試一下,在線閱讀器里不知道代碼會(huì)不會(huì)給過(guò)濾。。代碼在下邊,其實(shí)沒(méi)什么技術(shù)含量滴。挖哈哈。。。
復(fù)制代碼 代碼如下:
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('天啦!你的機(jī)器上竟然有軟件攔截彈出窗口耶,好討厭哦,人家不來(lái)了啦!快去掉嘛~~555~');
return false;
}
return true;
}
=。= 重寫window.open寫了兩天都沒(méi)有想到更好的辦法,參數(shù)要一個(gè)一個(gè)加,第四個(gè)參數(shù),似乎只是為了不被back回去,例如:
復(fù)制代碼 代碼如下:
window.open("a.html","a");
window.open("b.html","a","",true);
打開(kāi)的b.html是沒(méi)有后退可以按滴,MSDN有說(shuō)明 。
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.
JavaScript技術(shù):window.open被瀏覽器攔截后的自定義提示效果代碼,轉(zhuǎn)載需保留來(lái)源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。