Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jul 2011
    Posts
    172
    Thanks
    64
    Thanked 2 Times in 2 Posts

    <base target="_blank" />

    This can be added to the <head></head> section of a web page and all links open in new window... Do you know how to exclude one link (or individual links) from this declaration (or whatever the name is)?

    Thank you.


    # # # EDIT

    I added target="_self" and it does the job.

    Thank you.
    Last edited by joliett89; 12-08-2012 at 01:07 PM.

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,634
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Why are you using HTML 3.2?

    That was replaced back in 1997.

    Modern browsers are designed to allow the browser owner to decide where to open links - that's why those tags were not included in HTML 4.

    Also that / at the end of your tag is invalid in HTML 3.2.
    Last edited by felgall; 12-08-2012 at 08:29 PM.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    Regular Coder
    Join Date
    Jul 2011
    Posts
    172
    Thanks
    64
    Thanked 2 Times in 2 Posts
    So what would be the best way to accomplish the same thing according to 2012's standards?

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,634
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by joliett89 View Post
    So what would be the best way to accomplish the same thing according to 2012's standards?
    Simply delete all the target= references from your site and then your site will be compliant for 2012 with your visitors being able to choose where to open the links based on how they configure their browser.

    I have my browser configured so that by default relative links open in the same tab and absolute links open in a new tab. When I want something different from that I right click the link and I can select between "Open" (which will open where my default tells it to), "Open in New Tab", "Open in Background Tab", "Open in New Window", or "Open in Background Window".

    To make sure web sites don't try to override my choice I have the target attribute disabled but not everyone knows how to do that and so web sites that use it will generally annoy their visitors whose preferences don't match the way the site works.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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