1

How to open a url in new window without losing the focus of current window . I want to open a new url for every 20 secs of time. I used the following code in a page where the function is called after some time period but not working

var win=window.open(url,'_blank');
     window.focus();
HamZa
  • 14,671
  • 11
  • 54
  • 75
  • 1
    See this: **[Open new window without focus on it](http://stackoverflow.com/questions/15133605/open-new-window-without-focus-on-it)** – f605dcf7dc5542e93ae9cd76f Aug 14 '13 at 14:54
  • 6
    Give me the link of your website to add it to my blocked list – HamZa Aug 14 '13 at 14:54
  • 1
    i think this [link](http://www.infimum.dk/HTML/JSwindows.html) may be help full for you – user2529216 Aug 14 '13 at 14:56
  • Look at this: http://stackoverflow.com/questions/7522565/how-to-stay-on-current-window-when-the-link-opens-in-new-tab – Andrea Salicetti Aug 14 '13 at 14:56
  • why blocked list?? @HamZa ... anyways i used the focus and blur but not works for me –  Aug 14 '13 at 15:03
  • @SekharSeerapu I think you didn't get me. I'm already annoyed when I get a simple alert, let alone some random new windows **every** 20 secs. Are you insane ? – HamZa Aug 14 '13 at 15:04
  • @HamZa hahahah...funny, it's my client dream.i have to fulfill his requirement. –  Aug 14 '13 at 15:07
  • 1
    @SekharSeerapu Well atleast tell him that it's annoying and that it will chase most of *his* clients away. – HamZa Aug 14 '13 at 15:09

1 Answers1

1

This may help you... but it is not recommended to open new popups every 20 second since this will be the worst user experience ever

  1. create a new popup window using window.open()
  2. blur newly created window using window.blur()
  3. focus your main window using window.focus()
HamZa
  • 14,671
  • 11
  • 54
  • 75
Amith
  • 1,424
  • 1
  • 10
  • 22