aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes click of a link shud open in a new tab instead of new window using javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "click of a link shud open in a new tab instead of new window using javascript" Watch "click of a link shud open in a new tab instead of new window using javascript" New topic
Author

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

Lenovo ss
Greenhorn

Joined: Jun 03, 2008
Posts: 3
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

Joined: May 09, 2008
Posts: 28
use window.open('url path');
it will open o new window

good luck
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

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

Joined: Dec 11, 2004
Posts: 13410

"Lenovo ss",
Please check your private messages regarding an important administrative matter.
-Ben


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Eddie Lee
Greenhorn

Joined: Apr 27, 2005
Posts: 20
As Raj said. It's browser dependent and is set by the user in his/her own browser.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Lenovo ss
Greenhorn

Joined: Jun 03, 2008
Posts: 3
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

Joined: Jun 03, 2008
Posts: 3
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

Joined: Dec 11, 2004
Posts: 13410

"Lenovo ss",
Please check your private messages.
-Ben
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Jan 10, 2002
Posts: 61654
    
  67

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: click of a link shud open in a new tab instead of new window using javascript