Click here to Skip to main content
15,885,720 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
I am making a web page, in which I have to open a popup window from an buton after 8 seconds(8000 ms).
I want to put some delay(8 seconds) before a popup open automatically.


my problem is that mozilla firefox block my popup

Here is my code:


<html>
<head>
<script>
function call()
{
popup = window.open('http://www.google.co.in');
}
function caller()
{
setInterval(call, 8000);
}
</script>
</head>

<body>
<input type="button" önclick="caller();">
</body>
</html>
Posted
Updated 24-Apr-14 7:21am
v2
Comments
Richard C Bishop 24-Apr-14 13:23pm    
The only way to get around that is for the user to disable the popup-blocker. You could display an alert to tell the user to do so.
Sergey Alexandrovich Kryukov 24-Apr-14 18:04pm    
Right. Even better, working without pop-ups. OP won't be able to disable the blocker on the client side for any client other than himself.
—SA
Richard C Bishop 24-Apr-14 18:06pm    
Agreed!
Sergey Alexandrovich Kryukov 24-Apr-14 18:09pm    
And Solution 1 by Tadit shows a really good alternative...<br>
—SA

The most convenient way to tackle this problem is to implement jQuery Dialog[^].
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 24-Apr-14 18:05pm    
Exactly! A 5. (Please see my comment to the comment to the question by Richard C Bishop I posted a second earlier.)
I recommend OP to accept this answer and follow the advice.
—SA
Thanks a lot Sergey. :)

But you spelled my names as "Tadish" again... :D :P
Sergey Alexandrovich Kryukov 25-Apr-14 7:39am    
Oh, sorry; Fixed, will pay more attention for it next time; thank you for telling me.
This is not because I don't remember your correct name, just a mechanical slip of hand...
—SA
I know that.
I replied you because you said me to alert whenever mechanical slip happens. :P

Cheers !!!
Sergey Alexandrovich Kryukov 25-Apr-14 7:49am    
Of course; thank you.
—SA
Only the pages hosted by yourself can be opened automatically. If you want to open other sites automatically, you need to set them trusted. The security mechanism is not only implemented in FireFox, but also Chrome and IE.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900