More and more browsers now have the function of blocking pop-up windows. It doesn't matter if the ads pop up and are blocked. But if the customer blocks them when paying, it doesn't matter.
Gmail’s “Oops” is a classic, but the day before yesterday, Xinyun gave a more cool tip=. = Remember to test it after turning on browser interception. I don’t know if the code will be filtered in the online reader. . The code is below, it actually has no technical content. Dig haha. . .
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 ('Oh my god! There is software on your machine to block pop-up windows. It's so annoying. They won't come anymore! Get rid of it~~555~');
return false;
}
return true;
}
=. = After two days of rewriting window.open, I still couldn’t think of a better way. The parameters need to be added one by one. The fourth parameter seems to be just to avoid being back, for example:
window.open("a.html","a");
window. open("b.html","a","",true);
There is no back button when opening b.html. MSDN has instructions.
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.