No interception pop-up back ad code

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.