• 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

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
use window.open('url path');
it will open o new window

good luck
 
Ranch Hand
Posts: 479
1
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Lenovo ss",
Please check your private messages regarding an important administrative matter.
-Ben
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Raj said. It's browser dependent and is set by the user in his/her own browser.
 
Sheriff
Posts: 67746
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 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Lenovo ss",
Please check your private messages.
-Ben
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
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

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.
 
Poop goes in a willow feeder. Wipe with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic