opening a new window only absolute links

Discussion in 'HTML' started by steve, Oct 3, 2004.

  1. steve

    steve Guest

    Hi

    I know that opening a new window (target="_blank") is a bed idea but I
    have explain that to the client and he still want the links that are
    link to other domain names to open in new windows.

    I know that I can use <base target="main"> but that open all the links
    in new window.

    So how can I open in new windows only the links that are link to
    external sites ( absolute links ) or only the links that are in one
    table.

    Thanks
     
    steve, Oct 3, 2004
    #1
    1. Advertising

  2. steve wrote:
    > I know that opening a new window (target="_blank") is a bed idea but I
    > have explain that to the client and he still want the links that are
    > link to other domain names to open in new windows.


    So be more persuasive?

    > I know that I can use <base target="main"> but that open all the links
    > in new window.
    >
    > So how can I open in new windows only the links that are link to
    > external sites


    JavaScript. Loop through every anchor onload and dynamically set the target
    based on the value of the href attribute (if one exists).

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Oct 3, 2004
    #2
    1. Advertising

  3. steve

    Toby Inkster Guest

    Toby Inkster, Oct 3, 2004
    #3
  4. steve

    Dave Patton Guest

    "steve" <> wrote in news:cjp3b5$b4g$:

    > Hi
    >
    > I know that opening a new window (target="_blank") is a bed idea but I
    > have explain that to the client and he still want the links that are
    > link to other domain names to open in new windows.


    Have you explained that not only is it bad for usability reasons,
    but that no matter what method you use to 'force' this on users
    that if the user wants, they can disable it?
    Yes, not every user would know how, or have a browser that supports
    such control, but maybe once the client knows that what they want
    won't do what they want(some of the time), they will listen to reason.

    Some sites use a small visiual indicator next to offsite links,
    presumably because they are willing to believe that users are
    smart enough to decide for themselves if they want to open
    'offsite links' in a new window(or, with better browsers,
    a new tab).

    --
    Dave Patton
    Canadian Coordinator, Degree Confluence Project
    http://www.confluence.org/
    My website: http://members.shaw.ca/davepatton/
     
    Dave Patton, Oct 3, 2004
    #4
  5. Toby Inkster wrote:

    > Something like this?
    > http://examples.tobyinkster.co.uk/external-links


    Yes ... except you would use a Transitional DTD since the DOM 1
    specification states that some features assume the use of a Transitional
    Doctype and the target attribute doesn't appear in Strict. :)

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Oct 3, 2004
    #5
  6. steve

    steve Guest

    > Some sites use a small visiual indicator next to offsite links,
    > presumably because they are willing to believe that users are
    > smart enough to decide for themselves if they want to open
    > 'offsite links' in a new window(or, with better browsers,
    > a new tab).


    Yes I really did not think of that
    Thanks

    How can I achieve something like that

    for example

    link55 open link55 in new window
     
    steve, Oct 3, 2004
    #6
  7. steve

    Toby Inkster Guest

    David Dorward wrote:

    > Toby Inkster wrote:
    >
    >> Something like this?
    >> http://examples.tobyinkster.co.uk/external-links

    >
    > Yes ... except you would use a Transitional DTD since the DOM 1
    > specification states that some features assume the use of a Transitional
    > Doctype and the target attribute doesn't appear in Strict. :)


    If I had more time I'd set the onclick event on each link. :)

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Oct 3, 2004
    #7
  8. While the city slept, steve () feverishly typed...

    > Hi
    >
    > I know that opening a new window (target="_blank") is a bed idea but I
    > have explain that to the client and he still want the links that are
    > link to other domain names to open in new windows.


    Web Accessibility Guidelines, Checkpoint 10.1: "Until user agents allow
    users to turn off spawned windows, do not cause pop-ups or other windows to
    appear and do not change the current window without informing the user.
    [Priority 2]"

    Many nations are bringing in - or already have in place - legislation
    regarding web accessibility. Point out to your client that what he wants
    will break web accessibility, and could potentially land him in court.

    The best way to stop users leaving your site is to provide a site that they
    want to come back to. For example, on a good site, I may follow a link to an
    external site, view that, then go back through the history to return to the
    original site, or I may open the external site in a new window from the
    context menu, so I can get back to the original site with a quick alt-tab!

    Hope that helps,
    Nige

    --
    Nigel Moss
    http://www.nigenet.org.uk
    Mail address not valid. , take the DOG. out!
    In the land of the blind, the one-eyed man is very, very busy!
     
    nice.guy.nige, Oct 4, 2004
    #8
  9. steve

    jake Guest

    In message <>, nice.guy.nige
    <> writes
    >While the city slept, steve () feverishly typed...
    >
    >> Hi
    >>
    >> I know that opening a new window (target="_blank") is a bed idea but I
    >> have explain that to the client and he still want the links that are
    >> link to other domain names to open in new windows.

    >
    >Web Accessibility Guidelines, Checkpoint 10.1: "Until user agents allow
    >users to turn off spawned windows, do not cause pop-ups or other windows to
    >appear and do not change the current window without informing the user.
    >[Priority 2]"
    >

    These days, UAs can turn off spawned windows.

    The important thing is not to open a new window without first informing
    the user.

    >Many nations are bringing in - or already have in place - legislation
    >regarding web accessibility.


    True.

    >Point out to your client that what he wants
    >will break web accessibility, and could potentially land him in court.
    >


    No, not really. There's no accessibility issue here.

    >The best way to stop users leaving your site is to provide a site that they
    >want to come back to. For example, on a good site, I may follow a link to an
    >external site, view that, then go back through the history to return to the
    >original site, or I may open the external site in a new window from the
    >context menu, so I can get back to the original site with a quick alt-tab!
    >
    >Hope that helps,
    >Nige
    >


    --
    Jake
     
    jake, Oct 4, 2004
    #9
  10. steve

    Spartanicus Guest

    jake <> wrote:

    >>Web Accessibility Guidelines, Checkpoint 10.1: "Until user agents allow
    >>users to turn off spawned windows, do not cause pop-ups or other windows to
    >>appear and do not change the current window without informing the user.
    >>[Priority 2]"
    >>

    >These days, UAs can turn off spawned windows.


    Of the big 4 only Mozilla and possibly Firefox allows this, and since
    this setting is not in the GUI prefs most users would be unaware of this
    feature.

    >The important thing is not to open a new window without first informing
    >the user.


    "Informing the user" forces knowledgable users to do something extra
    which shouldn't be necessary, and the average user doesn't know how to
    open such a link in the same window/tab.

    The correct answer remains: stop wanting that.

    --
    Spartanicus
     
    Spartanicus, Oct 4, 2004
    #10
  11. steve

    jake Guest

    In message
    <>,
    Spartanicus <> writes
    >jake <> wrote:
    >

    [snip]

    >
    >>The important thing is not to open a new window without first informing
    >>the user.

    >
    >"Informing the user" forces knowledgable users to do something extra
    >which shouldn't be necessary, and the average user doesn't know how to
    >open such a link in the same window/tab.


    The important thing is not to open a new window without first informing
    the user.

    >The correct answer remains: stop wanting that.
    >

    The correct answer is to provide the facility if it's needed.

    regards.

    --
    Jake
     
    jake, Oct 4, 2004
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick Olurotimi Ige

    Closing child window when opening a new Window

    Patrick Olurotimi Ige, Dec 14, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    450
    Patrick Olurotimi Ige
    Dec 14, 2004
  2. UJ
    Replies:
    2
    Views:
    7,555
    John Timney \(ASP.NET MVP\)
    Jun 27, 2005
  3. BernieH

    Opening links in new window

    BernieH, Nov 25, 2004, in forum: HTML
    Replies:
    12
    Views:
    739
    Mark Parnell
    Dec 1, 2004
  4. metalive
    Replies:
    3
    Views:
    1,163
    Andy Dingley
    Jul 17, 2005
  5. James Byrne
    Replies:
    3
    Views:
    580
    James Byrne
    Sep 14, 2010
Loading...

Share This Page