Legally avoiding popup blocking

后端 未结 3 419
暗喜
暗喜 2020-12-17 16:17

What is causing some browsers to see my code as unsolicited?

I have a web site devoted to helping people with interactive sessions. It starts with the user clicking

相关标签:
3条回答
  • 2020-12-17 16:35

    No much you can do. You could ask your users to disable pop-up blockers or inform them that a pop-up blocker is enabled by checking the window object ref returned by window.open()

    e.g.

    var w = window.open('http://domain.com');
    if(!w) { 
       //an alert in this example
       alert('oops..seems like a pop-up blocker is enabled. Please disable');
    }
    

    you could find another way and try what Brad suggests.

    0 讨论(0)
  • 2020-12-17 16:41

    There isn't anything you can do about this. Some popup blockers still block everything, even in response to a user clicking. The best you can do is suggest your users turn off popup blockers, or find a different way to do what you want to do. A popular method is the div that appears on top of all others on your page, like Lightbox.

    There are many jQuery plugins which make this easy.

    0 讨论(0)
  • 2020-12-17 16:54

    You have (at least?) 2 options to deal with this:

    • if you want to keep using popups, display a very visible warning for your users, pointing them to instructions on how to configure their browser to whitelist your domain (like the banners that appear on top of StackOverlow.com when you gain new privileges, or even like the banners Chrome is showing for actions - they are web-based as well);
    • use an iFrame and load its content based on your user's click.
    0 讨论(0)
提交回复
热议问题