• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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:

 
Marshal
Posts: 67418
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • 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.
 
Do not threaten THIS beaver! Not even with this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic