Re: cdata and javascript



Jeff wrote:
Harlan Messinger wrote:
Jeff wrote:
Andy Dingley wrote:
On 28 Jan, 14:46, Jeff <jeff@xxxxxxxxxxxxxxx> wrote:

I don't have a problem with writing HTML XHTMLish, I even like the much
maligned <br />.

Why? That's just plain wrong.

Why? It's a self closing tag and it works in every browser. The trend is toward closing every tag you open.

In HTML, <br> is one of the tags (along with <input>, <link>, <meta:>, and so forth) that doesn't *have* a closing tag, so it's equally meaningless to make the opening tag a "self-closing" tag. Moreover, the slash has another meaning in SGML (HTML is to SGML as XHTML is to XML) as follows:

<title/My Page/

is equivalent to

<title>My Page</title>

Hmm, that's pretty wild but I think I've seen something like that in xml/xslt.

What happens if you have the space before the slash? Does SGML ignore whitespace there? I know an earlier version of NS needed the whitespace.

So

<br />This sentence has a / (slash) character.

would be treated in a correctly performing HTML user agent as

<br>>This sentence has a </br> (slash) character.


So, this:

<p />does this/

<p>does this</p>

That implies to me that / should join the list of entities that should be escaped as "<" and "&" are.

Well, yeah, if you were writing for user agents that followed this treatment correctly, and you wanted the equivalent of

<p>The / is called a "slash"</p>

you would need to escape it when writing it in this form:

<p/The &#47; is called a "slash"/


which is certainly not what you want. The reason

<br />

works in real browsers is that they haven't implemented that detail of SGML--in other words, it relies on a browser deficiency.

Well, I realize that <br /> is not valid in html 4. From what I can tell it is required in xhtml, which I have no desire to use since it gives me nothing tangible over html, but what I was thinking was whether this is going to be needed in html 5 which will get here someday. Or not.

Instead they
wind up treating the slash as something that simply doesn't belong there, and they handle it the same way they handle anything that doesn't belong there--they pretend it isn't there. That doesn't mean it's valid--it isn't. It's just being ignored.

On a side note, I notice an ever increasing number of pages with an xhtml doctype.


Jeff
.



Relevant Pages

  • Re: OT: HTML (WAS: MF having issues?)
    ... Right, the example above, with the tag, comes from web developers inapporpriately depending on undocumented features. ... But let's say I don't actually read the standards, but just try out the tag to see what it does, and I notice that on my particular browser, the tag displays the text in italics. ... So now my HTML page may be broken, for example, if it contained text like this: ...
    (comp.lang.cobol)
  • Re: Can you render and image in ASP.NET?
    ... the client (browser). ... the image bytes back to the browser, you will need an tag in the page ... HTML whose source is the ASPX page that constructs the image. ... > Is there any possibility to render images for the web in asp.net? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: OT: HTML (WAS: MF having issues?)
    ... But let's say I don't actually read the standards, but just try out the tag to see what it does, and I notice that on my particular browser, the tag displays the text in italics. ... So now my HTML page may be broken, for example, if it contained text like this: ... The idea is that browsers who do not recognize the <applet> tag will simply ignore that tag, and display the text without any special formatting. ...
    (comp.lang.cobol)
  • Re: java detection test on a webpage with applet
    ... the applet cannot be displayed in this browser. ... My understanding of HTML ... is that if the browser doesn't recognize a tag, it simply ignores it, so ...
    (comp.lang.java.help)
  • Re: Tail a logfile to a web page
    ... > different techniques usable with a web browser. ... A HTML interface ... The page will refresh every nn seconds. ... REFRESH is not a tag. ...
    (comp.infosystems.www.authoring.html)