Forum Moderators: open
It's listed in the XHTML 1.0 Strict DTD [w3.org]:
<!--================== The Anchor Element ================================--><!-- content is %Inline; except that anchors shouldn't be nested -->
<!ELEMENT a %a.content;>
<!ATTLIST a
%attrs;
%focus;
charset %Charset; #IMPLIED
type %ContentType; #IMPLIED
name NMTOKEN #IMPLIED
href %URI; #IMPLIED
hreflang %LanguageCode; #IMPLIED
rel %LinkTypes; #IMPLIED
rev %LinkTypes; #IMPLIED
shape %Shape; "rect"
coords %Coords; #IMPLIED
target %FrameTarget; #IMPLIED
>
I've stopped using it myself outside of frames.
(Then again, I don't run any commercial websites that need to keep visitors on the page as long as possible to suck money out of them...)
<!--================== The Anchor Element ================================-->
<!-- content is %Inline; except that anchors shouldn't be nested -->
<!ELEMENT a %a.content;>
<!ATTLIST a
%attrs;
%focus;
charset %Charset; #IMPLIED
type %ContentType; #IMPLIED
name NMTOKEN #IMPLIED
href %URI; #IMPLIED
hreflang %LanguageCode; #IMPLIED
rel %LinkTypes; #IMPLIED
rev %LinkTypes; #IMPLIED
shape %Shape; "rect"
coords %Coords; #IMPLIED
>
Comes from [w3.org...]
No target allowed.
I have tried my best to find out why it was removed from Strict, but none of the explanations that I have seen have convinved me that this was a smart move.I mean, if you can accomplish the same thing with javascript window.open and location.href then why take this, IMO very useful feature out of the DTD?
Are they going to outlaw Javascript next?
I know it's a pain but I've not only gotten used to it, but rather enjoy it now. I'm a reformed javascript addict btw.
The guidelines do seem to be pushing simplicity and I for one and all for it. I've long since disabled javascript and pop-ups since I personally find them annoying. And since I do, I've taken the "do unto others as you would have them do unto you" approach - hence no javascript or popups on my sites.
Will they ban JS? I don't think so. While I ranted about JS a few moons ago I know there are some useful attributes to it. It is a script language and I suspect it will be around for quite a while yet. Heck, DOS script commands are still in use. :)
I provided a link to the relevant page. The problem is, that this same page displays the DTDs for all three of XHTML-1.0 Strict, Transitional, and Frameset. Looks like I forgot to check that the excerpt is really from the strict version... ;)
Note that both the Transitional and Frameset definitions still allow to send anchors to a target. The first for compatibility reasons, the second because you can't do frames without.
Ok, now that I've learned that, I have to say that I'm really glad that it won't be possible for a web site to open a new window on my desktop with standard XHTML.
<!ENTITY % events
"onclick %Script; #IMPLIED
ondblclick %Script; #IMPLIED
onmousedown %Script; #IMPLIED
onmouseup %Script; #IMPLIED
onmouseover %Script; #IMPLIED
onmousemove %Script; #IMPLIED
onmouseout %Script; #IMPLIED
onkeypress %Script; #IMPLIED
onkeydown %Script; #IMPLIED
onkeyup %Script; #IMPLIED"
>
As I see it, if the reason for removing target is to discourage frames and pop-ups then any javascript methods that do the same must also be disallowed, otherwise what's the point?
To create a useful popup, you need Javascript anyway. The target attribute in a link will simply open the page in a new window, which normally has the same size as the previous one, and will completely obscure it in many cases. Most of the time, you want a popup to be significantly smaller than that. Being able to just stack arbitrary numbers of equally sized windows on top of each other isn't a very helpful HTML feature.
Thanks for all the replies.