Isn't this actually just using the target="_blank" attribute though? All
you've done here, as I see it, is to not use the target attribute in the
tag, but use your _javascript_ to add the target attribute to the tag. Now
I haven't really gotten into xhtml compliance, but I don't understand
the logic here? Why not go ahead and use target="_blank" in your code,
if you're going to use a js to put it there anyway????
--Ferg
_____
Yes, you can open in a new window with XHTML, just not using the
target="_blank" attribute which is wicked and nasty in XHTML and will
get
you banished from the kingdom. Do not pass go and do not collect $200.
I open external links usually in a new window, and while you can't use
the
target attribute, you can do it another way that's valid XHTML1.0
Strict,
but it uses a tiny amount of _javascript_.
To open in a new window using XHTML make your links like this:
[code]
<.a href="" rel="external">Macromedia</a>
[/code]
And you have a tiny piece of _javascript_ that you can have as an external
file referred to in the header (I call mine 'external.js'):
[code]
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.>
[/code]
Cheers
Mike Kear
Windsor, NSW, Australia
AFP Webworks
http://afpwebworks.com
.com,.net,.org domains from AUD$20/Year
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
- Photo Album Modification Mark Henderson
- Re: Photo Album Modification Jim McAtee
- Re: Photo Album Modification Les Mizzell
- Re: Photo Album Modification Jim McAtee
- RE: Photo Album Modification Mark Henderson
- RE: Photo Album Modification Michael Kear
- RE: Photo Album Modification Mark Henderson
- Re: Photo Album Modification Ken Ferguson
- Re: Photo Album Modification Mark Henderson