id versus name attributes in XHTML
Let's say I've got a page ("A") that has an inline frame ("B") in it. There are links on A that are supposed to open up inside B. The XHTML spec says to use the id attribute instead of name to name the iframe, right?
But when I put id="content" inside the iframe tag and then put target="content" inside the links the page opens up in a new window, as if there was nothing named "content".
If I use name="content" then everything works fine, but that's not XHTML compliant.
If I try id="content" and then put target="#content" inside the links IE freezes (v6 on XP w/ 512M RAM).
Suzanne posted this at 07:50 — 28th June 2002.
She has: 5,507 posts
Joined: Feb 2000
Since ID doesn't work for older browsers, you'll have to double up to get it to work, but the problem is validation.
http://www.w3.org/TR/xhtml1/#guidelines
I believe that target itself is deprecated, and you can use client side scripting to control the linking.
IanD posted this at 10:18 — 28th June 2002.
They have: 222 posts
Joined: Sep 1999
So, I should use iframe id="blah" name="blah" and a href="wherever.html" target="blah". But won't that only be working because of the name attribute? Because if it was only id in there it would just open it in a new window.
Are there any rules I have to follow when when choosing the value of id/name?
Fighting for a Lost Cause.net
Suzanne posted this at 21:15 — 28th June 2002.
She has: 5,507 posts
Joined: Feb 2000
You know, I'm not sure. I haven't tried to get xhtml working with a frameset.
There must be some references somewhere, I'll try to find out and report back.
Suzanne posted this at 21:29 — 28th June 2002.
She has: 5,507 posts
Joined: Feb 2000
http://www.webreference.com/xml/column6/4.html
#7 seems to be the same advice. I'll keep looking, though.
The naming convention would be the same, must start with A-Z or a-z, but can be otherwise alphanumeric, no special characters.
IanD posted this at 22:02 — 28th June 2002.
They have: 222 posts
Joined: Sep 1999
Cool, thanks
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.