1

I have a web page where I need to display popup (basically a event reminder). My user can set multiple reminder from my application. I have created a script for it but it is showing only first event reminder popup not all.

I have created one demo code which I can show here the same concept I have applied in my code.

<script>
$(function()
{
    setInterval(function(){
              for(i=0; i<3;i++)
               {    
                    var url = 'http://www.rediff.com';
                    var w = 550;
                    var h= 435;
                    var left = (screen.width/2)-(w/2);
                    var top = (screen.height/2)-(h/2);
                    window.open(url,'newwindow','width='+w+',     height='+h+', top='+top+', left='+left);
               }
        }
, 10000);
 });
</script>

If I remove the setinterval function from my script and run the page, it is showing me 3 popup of the URL: http://www.rediff.com simultaneously. But after applying setinterval it is showing me only one popup not 3 as in case 1st( i.e without setinterval). Why?

ashokostech
  • 307
  • 1
  • 5
  • 11
  • Your code should just work the same with and without the `setInterval`. – putvande Aug 10 '15 at 11:34
  • it works. Tested on firefox 39. your fiddle opens 3 windows every 10 seconds. Maybe you've got a security mechanism to avoid open multiple windows. Note that this script is considered an intrusism and very ugly bad practice. – Marcos Pérez Gude Aug 10 '15 at 11:36

0 Answers0