Click to See Complete Forum and Search --> : target attribute


Lizo
07-27-2003, 12:27 PM
When I validate my page for XHTML strict I get the error

no attribute "target"

What is the correct way to open a new window from a link, I am using target="_blank" at the moment.

AdamGundry
07-27-2003, 01:59 PM
You don't open new windows from links. It is against accessibility recommendations to popup new windows, which (I presume) is why the target attribute has been removed.

Adam

Lizo
07-27-2003, 02:27 PM
Oh ok, nevermind. Ill have to change it some time.

Thanks.

PeOfEo
07-27-2003, 04:06 PM
What do you mean? I use target="_blank" and I have never seen it being invalid. What if you are making a gallery or something, its nifty to open the pictures in new windows? How would opening in a new window be a bad thing?

Lizo
07-27-2003, 04:54 PM
What doctype do you use?

I currently use the XHTML Strict doctype and its probably that, thats causing my problem.

David Harrison
07-27-2003, 05:25 PM
If you're using js on your site then you may as well go the whole nine yards and use:
window.open("","","");

PeOfEo
07-27-2003, 10:41 PM
I use
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
and
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

But I dont have any target="_blank" attributes on the xhtml ones yet because those are just practice pages for css. But how the heck would the target attribute be bad? Also about the java script, no, I use java script as little as possible I really dont enjoy using it, I feel its downsides outweigh its benifits.

boojum
07-28-2003, 02:10 AM
personaly, i stick with xhtml transitional soley to use the target attribute. its often requested of me to have links to various other sites, and to have them show up in a subframe on the linking site. i push for the use of target=_blank instead -- the much lesser of two evils from my point of view. and i dont want a function filing through all anchors on every page for something i find so silly. so i stick with xhtml transitional, otherwise i would be xhtml1.1 valid

the w3c is dead set on making the dom another manditory recommendation, which is fine with me if everyone else can manage (like those used car salesmen that seem to double as programmers of readers-for-the-blind). xhtml2 expects javascript to provide access to the target attribute like strict and 1.1 do