Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-08-2012, 01:05 PM   PM User | #1
joliett89
Regular Coder

 
Join Date: Jul 2011
Posts: 172
Thanks: 64
Thanked 2 Times in 2 Posts
joliett89 has a little shameless behaviour in the past
<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..
joliett89 is offline   Reply With Quote
Old 12-08-2012, 08:26 PM   PM User | #2
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,447
Thanks: 0
Thanked 496 Times in 488 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
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.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/

Last edited by felgall; 12-08-2012 at 08:29 PM..
felgall is online now   Reply With Quote
Old 12-08-2012, 10:05 PM   PM User | #3
joliett89
Regular Coder

 
Join Date: Jul 2011
Posts: 172
Thanks: 64
Thanked 2 Times in 2 Posts
joliett89 has a little shameless behaviour in the past
So what would be the best way to accomplish the same thing according to 2012's standards?
joliett89 is offline   Reply With Quote
Old 12-08-2012, 10:48 PM   PM User | #4
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,447
Thanks: 0
Thanked 496 Times in 488 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
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/
felgall is online now   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:55 PM.


Advertisement
Log in to turn off these ads.