最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - What triggers the popup blockers in browsers? - Stack Overflow

programmeradmin1浏览0评论

In what circumstances do blockup blockers in browsers activate, and in what circumstances do they not?

Can you ever use an onclick event on a link to trigger a popup (other than target = _blank) or will that always trigger the blockers?

In what circumstances do blockup blockers in browsers activate, and in what circumstances do they not?

Can you ever use an onclick event on a link to trigger a popup (other than target = _blank) or will that always trigger the blockers?

Share Improve this question edited Feb 12, 2014 at 6:32 tshepang 12.5k25 gold badges98 silver badges139 bronze badges asked Aug 24, 2012 at 9:10 WillWill 4,7443 gold badges40 silver badges70 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

Most popup blockers are triggered when a popup is launched indirectly from a user action.

Some popup blockers are triggered when a user clicks, but most are not. Basically, if the popup is triggered within a click handler (or code that it calls), you are generally okay.

If possible, I would remend avoiding popups entirely. They tend to disrupt the user experience, with a few exceptions.

Here is a pretty detailed answer about pop-ups. Yes you can use an onclick event to trigger a popup and generally that's how ad panies make money -- they track your click to know you have seen the pop-up ad and count it so the people sending the pop-up to you get money.

Also here is a pretty detailed article on how pop-up blockers work.

发布评论

评论列表(0)

  1. 暂无评论