• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using target attribute is creating issues while opening multiple windows in Safari and Chrome

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a JSP page where I am trying to open a new link (supoose new link is: http://www.w3schools.com/) in a new window using the traget attribute upon submitting the form and I am also opening up another link (suppose another link is: http://www.google.com/) in the parent window using javascript. But if I run the code in Safari and Google Chrome, it only opens the second link (google one), it doesn't open the w3schools link.

Please advise if there is any alternative to target="_blank" or any other way to open both windows (When we open both the windows, the focus should be on w3schools window).

Here is the test JSP page that I have created to demonstrate the issue:

 
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please use proper indentation when posting code. You code is really hard to read.

It has nothing at all to do with target, but You've set up a race condition between the timer and the submit.

Back up a bit and explain what you're really trying to accomplish. Whatever it is, this isn't the way to do it.
 
All that thinking. Doesn't it hurt? What do you think about this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic