disable popup blocking

0

I want the user to enter a value through an Alert. If you block pop-ups for the script. Is there any way to skip the data entry line if the user blocks pop-ups?

    
asked by kamome 06.03.2016 в 09:58
source

2 answers

1

Another option, if the question you ask the user is very simple, instead of using a pop-up window use a prompt that is for that.

    
answered by 06.03.2016 / 19:49
source
3

You could detect if the window can not be opened

Test For Popup Blocker Using JavaScript

evaluating the variable that will have the instance of the window.

 var popUp = window.open('url', '', 'options');
 if (popUp == null || typeof(popUp)=='undefined') {     
     alert('Se bloqueo el popup'); 
  } 

You do not actually skip the line, you execute it and you evaluate whether the window could be opened or not.

A recommendation, because you do not use popup implemented in jquery

Jquery UI Dialog

With this you will no longer have a window blocking problem because you run inside it.

    
answered by 06.03.2016 в 12:41