Question : Delay window open on click with JQuery

Here is an example page: http://vincent-massaro.com/modal/modaltest.html

I am trying to have a window open with Jquery when a link is clicked, but delay the popup so that a message is first displayed before the popup happens. As you can see from the example the window.open happens on the click, but it appears setTimeout, triggers the browser's popup blocker because it is not being triggered by the user click input. Is it possible to have the delay and not trigger the popup blocker? Thanks!

Answer : Delay window open on click with JQuery

The only way around the pop-up blocker is to open the window during the click event handler.  You could implement a kind of "sleep" routine by running a loop until the timeout is reached, so that all the processing is still happening in the click handler (see example here: http://www.ozzu.com/programming-forum/javascript-sleep-function-t66049.html) .  However be aware that on most browsers you have a pretty short amount of time until the browser's "this script is not responding" message appears because it thinks the script is stuck in an unresponsive loop (which it essentially is).
Random Solutions  
 
programming4us programming4us