Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

click of a link shud open in a new tab instead of new window using javascript

 
Lenovo ss
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Frnds,
In my html page I have a link. The requirement is like onclick of the link it shud open up a page in new tab(same as IE7) instead of new window.

If any one have any idea on how to proceed for this pls help me out guys..

Thanks in advance..
Bye..
 
darshan karle
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use window.open('url path');
it will open o new window

good luck
 
Rajkamal Pillai
Ranch Hand
Posts: 445
1
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I think this is browser dependent. Mozilla Firefox 2.0.0.4 has a setting in the Tabs option which opens all links clicked in a New Tab or in a New Window. So if the setting has been set to 'New pages should be opened in' => New Tab then calling a window.open() using Javascript will result in the new page opening in a new tab instead of a different window.

Cheers,
Raj.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Lenovo ss",
Please check your private messages regarding an important administrative matter.
-Ben
 
Eddie Lee
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Raj said. It's browser dependent and is set by the user in his/her own browser.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64982
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use real words when posting to the forums. Abbreviations such as "shud" in place of "should" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.

thanks,
bear
JavaRanch sheriff
 
Lenovo ss
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Raj Kamal:
Hi,

I think this is browser dependent. Mozilla Firefox 2.0.0.4 has a setting in the Tabs option which opens all links clicked in a New Tab or in a New Window. So if the setting has been set to 'New pages should be opened in' => New Tab then calling a window.open() using Javascript will result in the new page opening in a new tab instead of a different window.

Cheers,
Raj.


Hi Raj,
Thanks for your reply.
Actually i need some js code for opening new tabs instead of browser settings. We have window . open to open new windows na ? similarly is there any way to open new tabs through Javascript?
 
Lenovo ss
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by darshan karle:
use window.open('url path');
it will open o new window

good luck


Hi Dharsan,
Thanks for your reply.
window.open is for opening new windows right? but my requirement is to open new tabs? if you have any idea abt his please reply back
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As stated already multiple times....NO you can not do it. It is a user's setting and nothing that you can control. Also make sure you check your private messages as stated by the moderators.

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64982
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lenovo ss:
if you have any idea abt his please reply back
You have already been asked once. Please use real words when posting. Use "about" not "abt".

I'd also be mindful of the messages Ben is sending you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic