Reply LinkBack Thread Tools Search this Thread
Old 16-08-2006, 15:16   #1 (permalink)
misterphotoshop
Senior Member
 
misterphotoshop's Avatar
 
Join Date: Jul 2004
Location: Ontario
Posts: 138
xhtml strict 1.1 not supporting target="new"?

Hey guys Im working on this website and Im making it strict xhtml1.1. Apparently target="new" isnt supported so anyone have any ways of getting around this without using javascript or anything?

Thanks.
  Reply With Quote
Old 16-08-2006, 15:23   #2 (permalink)
mx
fucksocks™
 
mx's Avatar
 
Join Date: Jun 2005
Location: in the boosh
Posts: 1,615
no. if you want to open stuff in a new window you need to make the doc type transitional
__________________
  Reply With Quote
Old 16-08-2006, 16:10   #3 (permalink)
pgo
i'm done, son
 
Join Date: Jan 2005
Posts: 12,262
Or use a JavaScript new window script.

And I honestly don't get the point of using XHTML 1.1 as it needs the mime-type "application+xhtml/xml" or whatever and that's not supported by IE.
  Reply With Quote
Old 17-08-2006, 00:01   #4 (permalink)
Red Cap
senior member
 
Red Cap's Avatar
 
Join Date: Sep 2005
Location: auckland, nz
Posts: 274
heres a simple js script, just put rel="external" in your link instead of target="_new"

function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
}
window.onload = externalLinks;
  Reply With Quote
Old 17-08-2006, 07:34   #5 (permalink)
mike_m
Work faster microphone ..
 
mike_m's Avatar
 
Join Date: Feb 2003
Location: Cambridge, UK
Posts: 1,706
  Reply With Quote
Old 17-08-2006, 07:41   #6 (permalink)
misterphotoshop
Senior Member
 
misterphotoshop's Avatar
 
Join Date: Jul 2004
Location: Ontario
Posts: 138
Its okay guys Im not even using strict anymore :-p
Sorry for the inconvenience and thanks for the help.
  Reply With Quote
Old 17-08-2006, 07:43   #7 (permalink)
gray
i still want paying
 
gray's Avatar
 
Join Date: Oct 2003
Location: newcastle, uk
Posts: 4,728
well theres a good solution!
  Reply With Quote
Old 17-08-2006, 08:49   #8 (permalink)
stickmus
hmmm...
 
stickmus's Avatar
 
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,130
Quote:
Originally Posted by Luke A
I know you are trying to help, so this isnt a rant at you.
  • According to the W3C around 10% of users have disabled javascript or use a browser that doesnt support it.
  • Then you have all the paranoid firefox users using "noscript" which is in the top ten extensions that blocks JS by default until you enable it.
  • Then you have all the various kinds of popup blockers, which almost everyone has by now.
  • Then you have the impact of using more code than is necessary. Not usually a problem for a small site, but for a busy big one?
  • You are also breaking your outgoing links for google spiders

If you need to open new windows, follow the W3C's advice and use the proper doctype (and target="_blank"). You aren't any less geeky, or clever, or whatever by not using "strict" or the latest xhtml. Infact by choosing to use the wrong doctype id say you are showing a complete misunderstanding of the point of declaring a doctype.

You're right about using xhtml 1.1 - only if necessary. But you're wrong about google. The code is progressively enhancing so google will happily pick up the content. As for size, an externally linked javascript is hardly going to matter much, it'll be cached after the first visit. And for a busy big site, if you add up every external links target attribute I'm sure it wouldn't take many before you'd actually be saving bandwidth with a script like that.
__________________
George Smith - a vain attempt to get higher on google for my name

  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8