Re: Some Early Topics



kangax wrote:

Thomas 'PointedEars' Lahn wrote:
kangax wrote:
David Mark wrote:
But if it is inline script, you need to escape the slash so the second
string value isn't mistaken for a closing H1 tag.

document.write("<h1>" + x +"<\/h1>");
Yeah, one of those things that standard and de-facto standard disagree
on.
How did you get the idea that invalid markup would be a de-facto
standard?

The same way anything else would be considered a de-facto standard.

Then you are mistaken, because a de facto standard is something that is not
(yet) standardized, although regarded so common *and useful* that it is
widely accepted by the public, in particular by the professional community
that it concerns. ("De facto" being Latin for "concerning the fact" or "in
practice".) A synonym is "best current practice" (BCP).

But invalid markup does _not_ appear to be widely accepted, nor does it
appear to be considered best current practice. In fact, there is the
strong recommendation to use Valid markup even though there is built-in
error correction (because while that feature has some informal
recommendations regarding it, there are no must-haves, and therefore it
cannot be relied on).

Do we not see this confirmed every time someone reports problems with a Web
site using invalid markup, and is being told by several rather knowledgable
people to fix their markup first as the problem is likely going to go away
then?

A million flies can't be wrong?

You have evaded that part of the question as well. A great number of
amateurs misusing the feature of built-in error correction, most of the
time without knowing it, does not make their doing any more a de facto
standard than any other of their mistakes.

I've tested the whole slew of browsers—ancient, mobile, desktop,
etc.—and none would close the script tag on discovery of ETAGO.
You need to test more, and refine your tests. The issue is known to
occur with "<script ...>...</script>" in particular, but it has been
observed on other occasions as well.

<script>...</script> is exactly what I've been testing. What more is
there to test if the purpose was to check if SCRIPT content is parsed
properly?

The SCRIPT element with a `type' attribute, and perhaps "nested" SCRIPT
elements.

And which other occasions are you talking about? I haven't seen a client
that respects HTML 4.01 in this regard and closes SCRIPT element on
first occurrence of "</". Have you?

I am sure that the W3C Validator does, IOW not fixing this error makes
further validation of the document using this tool next to impossible.

I do not remember which browsers did this, but there must have been at
least one popular one among them or it would not have become such an issue
in the first place. Probably the list would include W3C Amaya. Lynx,
which is sometimes used by server administrators and as input for
screenreaders, is at least known to report invalid markup visibly (in the
status line), which would not look too good. Very likely further
information can be found in the archives in postings containing the term
"ETAGO" or "End Tag Open delimiter".

By the way, that reminds me of a similar misconception I had found on your
Web site that I did not find time to mail you about yet (so I am doing it
here and now, lest I forget again): You stated there something along the
lines that it would not matter that in XHTML the content of `script'
elements was not, where necessary, properly escaped or declared CDATA,
because the Content-Type `text/html' would not trigger an X(HT)ML parser
anyway. However, first of all you cannot know for sure which parser is
being used, and second it matters for the W3C Validator and any other
markup validator because they MUST NOT care for the Content-Type of the
markup resource with regard to syntax except for the `charset' parameter.
IOW, the markup is still _not_ Valid then. So by _not_ using Valid markup
there, you are shooting yourself in the foot there, too.


HTH

PointedEars
--
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
-- Richard Cornford, cljs, <cife6q$253$1$8300dec7@xxxxxxxxxxxxxxxx> (2004)
.



Relevant Pages

  • Re: Color of disabled radio buttons
    ... markup would be not Valid. ... It depends on the DTD, and the issue has no impact on the functionality ... Having the bit that calls the validation function right there in the ... caching to move script out of the document. ...
    (comp.lang.javascript)
  • Re: Documenting a server conf
    ... Yes vim it's fine, I use it for system files, but how do you organize ... with a small shell script. ... markup is mostly a non-issue. ... a halfway reasonable markup and adding a troff generating backend next ...
    (comp.unix.admin)
  • Re: How to capture WMP events with script (and not HTML)?
    ... > must use SCRIPT FOR..EVENT tags. ... The generic and standard way to sink events from an object ... pages, like MSHTML and XMLHTTP, add another custom mechanism ... ActiveX controls because those controls only know about the ...
    (microsoft.public.windowsmedia.sdk)
  • Re: Accessing image property in IE when theres a period in the html ID?
    ... It was caused by using invalid markup, and DOM scripting on ... standard, it is specified in a second standard already. ... There is going to be a test case in the DOM Support Matrix.) ...
    (comp.lang.javascript)
  • Re: RfD: N>R and NR>
    ... You are running backwards - generating HTML, ... You came close to an effective system for standard scripting functions ... in a shell script. ...
    (comp.lang.forth)