GIDForums  

Go Back   GIDForums > Webmaster Forums > Web Design Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 13-Aug-2003, 05:18
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough

New-Window Links in a Standards-Compliant World


Standards are definitely the way to go if you want a well respected site that renders well, but the problem with standards is that they can restrict what you actually want to do.
In the XHTML and HTML 4.01 strict standards, the target function has been removed meaning that any link that opens in a new window is not standards compliant. This is a huge annoyance, especially if you are wanting to keep people on your site.
This article gives some good ideas: http://www.sitepoint.com/article/1041/1 although its looking like javascript will be required to do it properly and be standards compliant.

One (very bad) way to do it is
Code:
<a href="http://www.whatever.com" onclick="this.target='_blank';">

One (bad) way to do this in javascript
Code:
<a href="http://www.whatever.com" onclick="window.open('http://www.whatever.com','_blank'); return false;">

To be honest though, it looks like this function will be phased out, but for the near future this may be the best way to go.

Rob
  #2  
Old 13-Aug-2003, 05:39
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Where does it say this on www.w3.org ? I have looked as much as I can just these past few minutes and all I could find was this: http://www.w3.org/TR/1999/REC-html40...ml#adef-target but it doesn't mention anything else about it being deprecated or whatever in HTML 4.01 Strict or XHTML!
  #3  
Old 13-Aug-2003, 05:46
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough
Look for the bit after "Index of attributes"
http://www.w3.org/MarkUp/html40-upda...9971218-errata

Quote:
The "href" attribute for the BASE element should not be marked as deprecated. The DTD and prose correctly indicated that it is not deprecated.

The "target" attribute should not be marked as deprecated. Though not deprecated, it is not defined in the Strict DTD either.

The "language" attribute for the SCRIPT element should be marked as deprecated and should not be in the Strict DTD.

Oh it says its deprecated here: http://www.w3.org/TR/REC-html40-9712...ml#adef-target
  #4  
Old 13-Aug-2003, 05:51
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
I think the key phrase is here:
Quote:
The "target" attribute should not be marked as deprecated. Though not deprecated, it is not defined in the Strict DTD either.

I would take that to mean that it will be defined eventually?
  #5  
Old 13-Aug-2003, 05:52
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough
Sorry you probably didn't see my edit in time:
Quote:
Oh it says its deprecated here: http://www.w3.org/TR/REC-html40-971...tml#adef-target
  #6  
Old 13-Aug-2003, 05:58
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
The link above this post is a 404... and I think I must be blind because I couldn't see the bit where it says it's deprecated. Even used the "Find on this page" feature with no luck....

Help? ??:
  #7  
Old 13-Aug-2003, 06:01
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough
The quote, quoted the link literally. Here we try again
http://www.w3.org/TR/REC-html40-9712...ttributes.html
  #8  
Old 13-Aug-2003, 06:08
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Yeah OK, I have one of those too!

This link is from the latest version: http://www.w3.org/TR/html401/index/attributes.html

Notice it no longer has the D in there...
  #9  
Old 13-Aug-2003, 06:38
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough
Your right, but going back to the original point, it is only accepted in the transitional doctype and not the strict.
 
 

Recent GIDBlogProblems with the Navy (Enlisted) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 02:02.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.