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);
}
There is no difficulty in the principle of back-pitching advertising, but the open window loses focus (blur), and the original page gets focus. But for the popular browser, if the non-User Behavior pop-up window (that is, onload, direct window.open), will be blocked by the browser default.
Back to advertising, since it is called advertising, then how to let advertisers spend the money is really willing to spend it?
We can increase the judgment, if the pop-up window is blocked by the browser, so long as the user clicks on the page to trigger the window.open event, so generally will not intercept, the browser will think that this is the user's default behavior.