Since advertising is called advertising, how can we make Advertisers spend money and enjoy it?
We can add judgment. If the pop-up window is intercepted by the browser, the window. open event will be triggered as long as the user clicks the page. This will not be blocked, and the browser will think this is the default behavior of the user.
The code can be written as follows:
Copy codeThe Code is as follows:
Var $ E = YAHOO. util. Event;
Var adPopup;
Var popAd = function (sURL, sName, sFeatures, bReplace ){
If (adPopup) return;
If (sName = undefined ){
SName = '_ blank ';
};
If (sFeatures = undefined ){
SFeatures = '';
};
If (bReplace = undefined ){
BReplace = false;
};
AdPopup = window. open (sURL, sTarget, sFeatures, bReplace );
AdPopup. blur ();
AdPopup. opener. focus ();
$ E. removeListener (document. body, 'click', arguments. callee );
}
Try {
PopAd ();
} Catch (e ){
$ E. on (document. body, 'click', popAd );
}
Of course, if the user's browser has installed the interception plug-in, it is likely that it will not pop up (for example, the Firefox noscript plug-in will not allow any pop-up window ). The method is neither absolute nor optimal, but the most efficient thing is done with the least time.
PS: The window can be displayed by simulating form submission. The traversal is good (compared with the plug-in of the general interception window), but the content of the sFeatures parameter cannot be set.