Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 32

Thread: How to Open links in New Tab of browser with Javascript or VBscript

  1. #11
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    The standard key for opening in a new tab is middle click...
    Works in FF, IE7, and Opera.
    The user can configure/force all the links to open in new tabs. it's their decision where they want a new page to open.
    - Ryan "Boxxertrumps" Trumpa
    Come back once it validates: HTML, CSS, JS.

  2. #12
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by boxxertrumps View Post
    The standard key for opening in a new tab is middle click...
    Works in FF, IE7, and Opera.
    The user can configure/force all the links to open in new tabs. it's their decision where they want a new page to open.
    We knew that. Raj is determined to take that decision out of the user's hands. I don't think it can be done and have already stated as much in this thread.

    Additionally, I just tested the event property keyCode. It also is a getter and not a setter so, as I also said earlier:

    You used to be able to create a new event object:

    var ev=new Event()

    and assign its type and other property values, we would use (if we could still do this):

    ev.type=keydown
    ev.keyCode=17
    But we cannot.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #13
    Join Date
    Apr 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Is there any way of controlling the DLL ? I am also looking for an option through ActiveX. Since we can local hard drive with ActiveX and Javascript there might be way to control the browser? Don't you think so?

  4. #14
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Raj View Post
    Is there any way of controlling the DLL ? I am also looking for an option through ActiveX. Since we can local hard drive with ActiveX and Javascript there might be way to control the browser? Don't you think so?
    I had mentioned earlier that both Active X and Java (not javascript) might be able to do this but, all users in their right mind that know anything about these languages would block anything of the sort. And, this level of client manipulation is blocked by default in all current release browsers that I know of.

    I wish to repeat, "Why not just let the user decide?" You never answered that question.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #15
    Join Date
    Apr 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    No John, this is a requirement of my company that is why I am looking for this solution. For non-tabbed browsers a new window should open and for tabbed browsers it should open in a new tab.

  6. #16
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    a requirement of my company
    That doesn't tell me much and doesn't really answer the question. What's your company? Is it just you? Why is it a requirement?

    If I had a client who wanted this, I would just say; "Can't and shouldn't be done."

    The target="_new" attribute of a link will open it in a new window or tab depending upon the browser:

    HTML Code:
    <a href="some.htm" target="_new">Link Text</a>
    If you want to avoid the target attribute due to validation concerns, use javascript:

    HTML Code:
    <a href="some.htm" onclick="window.open(this.href);return false;">Link Text</a>
    That's the best you can do.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #17
    Join Date
    Apr 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well John, I think you understand that every project has some requirements. I wouldn't be able to give you the details but one such requirement (if possible) is this. Opening some links of a html page in new window or Tab, again if possible.

    Anyways, currently I feel it will be hard to open in a new Tab, may be in future.

    Thanks Alot for your help & time. Really appreciate it...

  8. #18
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    You can't. Period.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  9. #19
    Join Date
    Feb 2007
    Location
    🌎
    Posts
    528
    Thanks
    10
    Thanked 10 Times in 10 Posts
    Blog Entries
    2

    Default

    In IE on Windows, to open a link to main.htm that is an image called home.jpg that says Home by pressing Alt+H, use the code:
    HTML Code:
    <a href="main.htm" accesskey="h"><img border="0" src="home.jpg" alt="Home"></a>
    ....(o_ Penguins
    .---/(o_- techno_racing
    +(---//\-' in
    .+(_)--(_)' The McMurdo 500

  10. #20
    Join Date
    Apr 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up It Can Be Done

    Just go to: http://browservulsel.blogspot.com/20...ener-user.html

    this guy seems to have cracked it............I hate it when people say something cant be done, its so anoying.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •