views:

67

answers:

1

I have turned on PopUp blocker in FF and Chrome. I have a piece of code to check PopUp is working as:

function checkPopUp()
{
  var myTest = window.open("about:blank","","directories=no,height=1,width=1,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,top=0,location=no");
  var popUpsBlocked = '';
  if (!myTest) {
    popUpsBlocked = true;    
  } else {
    popUpsBlocked = false; 
  }
  return popUpsBlocked;   
}

its working fine "onload" of the page. But when i am using it with hyper link onclick, its not working a popup is getting opened.

 <a onclick="checkPopUp()" href="#">Test</a>
A: 

Browsers allow popups during "click" event loops. Different browsers have different configuration options under user control, but generally the default behavior is that a "click" is treated as a user willingly requesting functionality from a page.

Pointy
Thx for ur comment.But when i click Button, PopUp window function works, but in the same function there is an ajax request and in the reseponse i am calling the same Pop up function, its not opening up........Why so ?