• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to open page in new tab

 
kavita vala
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using ajex to take url from database and than i want to redirect it on new tab.
How it is possible using javascript using



But this code open url in same page than how to open it into new tab

Thanks in advance
 
Muthukrishnan Manoharan
Ranch Hand
Posts: 91
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65129
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ajex?

Please take as much care when posting as (hopefully) you would when writing code.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65129
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The short answer is: you can't.

The longer answer is that using the target attribute of a form (whose action you can fill in from the URL returned from the Ajax request) can be set to open the response in a new window. Whether that creates a new browser window or creates a new tab is not under your control., but is a browser setting specified by the user (which you, thankfully, cannot override).
 
kavita vala
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know



but it is not working in mozilla. Is that any other way to open a page in new tab
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65129
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you know then why are you still asking?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic