Re: [NH] What's So Great About XHTML?
- On Sun, 15 Dec 2002 14:45:52 -0000, wilkinsonm <mikew@...>
> I've read that HTML authors should move to XHTML because it requires moreScripts using ID should still work in recent browsers, but will fail in
> consistent coding and is a step toward XML. OK, I thought I'd play along,
> but I discovered that the "name" attribute is deprecated in favor of
> don't work.
Netscape 4 and old IE versions.
> Documentation at w3.org suggests that I should consider using both "name"XHTML is needed if you make use of automated systems like XSLT processors
> and "id," but then I will always get error messages if I validate the
> All of this leads me to my question. "What's so great about XHTML?"
on the server. Otherwise there's little gain relative to writing valid HTML
4.01 Strict, which is basically the same, but with a slightly different
syntax. Using deprecated elements and attributes (and so the Transitional
doctype) is only needed if you don't know enough CSS to get the same
effects, or if you still want to support Netscape 3.
If you don't like having choices | Rijk van Geijtenbeek
made for you, you should start |
making your own. - Neal Stephenson | mailto:rijk@...
- Hi wilkinsonm,
wmwc> text field (for example) unless it is named.
wmwc> like this:
wmwc> var value = document.form1.input1.value
I would do it like this:
<form name="form1" action="etc.htm">
<input id="input1" (other attributes)>
This is (IMO) a better way to do it anyway, because that input field
is no longer even tied to a form... it could be anywhere. In this way
you can pull other tricks too, like for instance you can take any text
on the page at all, or whole forms, or anything and surround it with
one of these:
something like this:
document.getElementByID("thissection").style.visibility = "hidden"
and hide that portion of the page. "getElementByID" in conjunction
with ID tags will very quickly become your friend.
wmwc> However, do you really, honestly, realistically think XHTML will make
wmwc> pages render correctly on all browsers? It just seems too good to be
wmwc> grue, considering the history of Internet Explorer, Netscape, etc,
Well, the problem is that we are in a poor state now. Browser vendors
and authors both have to work to set things right. By coding in valid
XHTML, we can do our part, as well as ensuring that our pages will be
usable in fashions we can't even imagine at the moment.
>"getElementByID" in conjunctionThanks for the tip!
> with ID tags will very quickly become your friend.
> Well, the problem is that we are in a poor state now. Browser vendorsOK - that makes sense.
> and authors both have to work to set things right. By coding in valid
> XHTML, we can do our part, as well as ensuring that our pages will be
> usable in fashions we can't even imagine at the moment.
- JW> document.getElementByID("input1").value
My apologies to anybody who read this, it's getElementById (with a