XHTML 1.1 Anchors

admin

Administrator
Staff member
Stefan, told you I'd be back!<br />
<br />
I'm updating all my pages to XTHML 1.1...a particular page is a collection of links. I want the links to open in new windows when they are clicked. Prior to XTHML I could just use the attribute "target", but that is not supported in 1.1...how can I have them open in new windows? I know I could use JavaScript, and I know how to do that, but is there a way to do it with basic XHTML?<br />
<br />
Thanks!<!--content-->Nope, there's no HTML attribute for it in XHTML 1.0 Strict or newer. You have to use JavaScript (which is a bad idea in my opinion because Mozilla reacts to right and middle-clicks as well as left-clicks for the onclick event hander).<!--content-->Originally posted by Rick Bull <br />
because Mozilla reacts to right and middle-clicks as well as left-clicks for the onclick event hander<br />
Gee, that kind of makes more sense to do it that way, doesn't it? After all, they *are* all "clicks". The handler can check which click it was and act accordingly (there are also other modifiers - shift, alt, cntrl - that can be used for clicks). <br />
<br />
The "onmousedown" and "onmouseup" has always acted on all clicks.<br />
<br />
Oh, yeah! How about "ondblclick"? I've never seen *that* work like I would expect.<br />
<br />
Then there are people that change their mouse button definitions...<br />
:-)<!--content-->Originally posted by Rick Bull <br />
Mozilla reacts to right and middle-clicks as well as left-clicks for the onclick event hander <br />
<br />
That is actually considered a bug and will be fixed (mainly becuse it breaks right-click contextmenus).<br />
<br />
onclick will eventually be triggerd only for left-click.<!--content-->Originally posted by matthurne <br />
but is there a way to do it with basic XHTML?<br />
<br />
<br />
Currently you would have to back down to 1.0 Transitional on webpages that you require target on.<br />
In XHTML 2.0 it will be back however together with the new X-frames (don't hold your breath though, it's due for 2004).<!--content-->Ah I thought it may have been a Mozilla bug. Can't really understand why it hasn't been fixed yet, it must be pretty easy.<br />
<br />
Originally posted by gil davis <br />
Then there are people that change their mouse button definitions...<br />
:-) <br />
<br />
That's exactly what I've thought before. You could do a button check, but what if the right button is the one that opens it. I prefer to just let the user choose which page to open in a new window. I find it annoying now days when window open automatially.<!--content-->
 
Back
Top