SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: Opening new TAB

  1. #1
    SitePoint Zealot barleytwist's Avatar
    Join Date
    Dec 2005
    Location
    Lulworth, Dorset, UK
    Posts
    183
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Opening new TAB

    Is there some equivalent js for the 'open new window' but in a new TAB. I am looking for some code to do this. It must be accessible. There must be a test for TAB ability in the browser and default options to 'new window' or _self?

    Many thanks.

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    There isn't. It can't be done. Perhaps in the future. Microsoft 20 years after that.

    The best thing to do is not annoy people by opening things in unexpected places, make it a regular link and let your users choose where they want to open this link. I can tell you that I hate new windows opening without warning, so I've set Firefox to open everything in the same tab.

  3. #3
    SitePoint Zealot barleytwist's Avatar
    Join Date
    Dec 2005
    Location
    Lulworth, Dorset, UK
    Posts
    183
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So I guess this is a browser API facility which is not provided. Of course a Rclick will allow selection of a new tab.

    I am trying to get a handle on why people may get annoyed with a new window. Does it relate to loosing control or sight of something? It's not really like an advert in a new window which does P me off somewhat.

    What about opening a new window for a pdf or document; would this be acceptable? If not, how does one cope with the reader window (e.g. Adobe reader) which tends to loose the 'browser look' of the window?

  4. #4
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Actually, it is very much like a popup advertisement: it appears with no warning, there is no indication that it's going to show up, multiple windows clutter up the taskbar, they are harder to keep control of than tabs (you can see what tabs you have at all times), they take time to render on slower computers, they often need to be maximised first, popup blockers block them (thus rendering your link unusable, leaving the user in a bewildered state as to what happened when they clicked the link), they make the application use more memory... they're not nice.

    If you really want to open a new window, put some text next to the window saying "(will open a new window)" or inform people that it's a PDF document so that they can then do whatever they want with it.

    It's always bad practice to guess what the user wants, to assume what's best for the user. We all have different quirks and different things that annoy us. That's why you should keep it as close to the default as possible and let the user make their choice.

  5. #5
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by barleytwist View Post
    I am trying to get a handle on why people may get annoyed with a new window.
    If I want to remain on a page, I'll choose to open links in a new tab (Shift+click or Shift+Enter in Opera).

    If I activate a link without using any modifier keys, that means I want to leave the current page and replace it with the linked-to page. If an unfriendly webmaster forces the link to open in a new tab or window, I'm annoyed because I have to go back and kill the original window even though I had already specified that I didn't want it anymore.

    This is especially annoying when there is no visual clue or warning that a new tab/window will pop up.
    Birnam wood is come to Dunsinane

  6. #6
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    There's GM_tab(), but that's only available to Firefox users who have the Greasemonkey extension installed. In any case, what if I like opening separate windows instead of tabs? Or just not having a new tab at all and opening new pages in the same window?

  7. #7
    SitePoint Zealot barleytwist's Avatar
    Join Date
    Dec 2005
    Location
    Lulworth, Dorset, UK
    Posts
    183
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ok, thanks

    I will give this some more thought.


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
  •