0

In my application we are using popup window Ex. window.open(); while i am trying to log in, every time the Popup window is blocked in IE 7, IE 8 and IE 9.

how to disable it using JavaScript code.

thanks in advance..,

ELAYARAJA
  • 521
  • 3
  • 10
  • 23

1 Answers1

1

Popup blocker is supposed to stop popup windows attached to such events as onload and onunload (and other events not directly associated with the person requesting a popup) from appearing but is not supposed to block those attached to an onclick event on a link (and other events that can be taken to mean that the person has requested it).

Not all browsers are smart enough to realize that if the onclick event on a link calls a function and the purpose of that function is to open a popup window that the popup has in fact been requested. They see the popup code in the function but are not clever enough to see that this code is called as a result of an action by the person using the browser. Coding our popup that way leads to the popup being blocked despite the fact that it was requested, a sure way to get someone annoyed that your site doesn't work properly despite the fact that the problem is actually their browser.

The way to fix this for many of these dumb browsers is to place the popup code into the onclick itself instead of calling a function.

For Example,

<a href="some_page.html" onclick="window.open('some_other_page.html')">Open Popup</a>

Here are some previous posts that might help you,

Bypass popup blocker on window.open when JQuery event.preventDefault() is set

Blocked vs Non-blocked Pop-up window

Community
  • 1
  • 1
Vijay Sarin
  • 1,326
  • 1
  • 11
  • 31