Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Re: shorttags

Thread Tools

Re: shorttags

Posts: n/a
On Jul 24, 5:42*am, sheldonlg <sheldonlg> wrote:
> I am trying to debug an application that is an intranet app behind a
> firewall accessible only via vpn. *The problem I am having is that the
> tables sorting is now working properly in Firefox 2.
> Doing a "view source" only yields the template, as the the page is
> written as a response back from an AJAX call. *So, I went to internet
> explorer and did a javascript:document.write(mainwapper.innerHTML). *My
> intent was to build a page that was close to what the actual page was by
> doing a "view page" from there and cutting and pasting.

There is no public specification for innerHTML, so what it produces is
entirely implementation dependent. Since IE doesn't know what XHTML
is, it is unlikely that its version of innerHTML will generate valid

Similarly, in Firefox, the markup generated by innerHTML is not
identical to the original source. For example, tags that do not need
to be closed in valid HTML 4 strict such as P, LI, TD, etc. are closed
in Firefox's innerHTML even if they aren't in the source. Further,
when browsers get invalid markup they will perform error correction to
fix it. In these cases, the innerHTML reflects the modified DOM, not
what was sent.

Therefore there seems little point in using innerHTML to validate
markup. What you are validating is the ability of the browser to
generate valid markup from its DOM.

> The problem with this procedure is that it converts things like id="foo"
> to id=foo. *Doing a validation with W3C then yields tons of errors
> stating that SHORTTAGS YES needs to be there. *Researching how to put it
> in gave me to info to change the doctype. *I don't want to do that, as I
> want to keep it "strict" and XHTML.

Validators are intended to validate the markup *sent* to user agents.
What you are trying to validate is the markup that the UA *generates*
from its DOM. It is quite possible that you send valid markup, but
that the innerHTML generated by the UA is not (and vice versa).

> How can I get the writing to not strip off the surrounding quotes?

Write your own "DOM to source" function?

> While we are at it, --- and this may sound simple ---, W3C validation
> with "strict" complains about align="center" for <td>, and about other
> attributes. *How can I write these to accomplish the centering and still
> be compliant with the "strict"?

Use CSS.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: shorttags BootNic HTML 2 07-25-2008 09:22 PM
Re: shorttags Andy Dingley HTML 4 07-25-2008 08:10 AM
Re: shorttags Morten Holt HTML 9 07-24-2008 03:12 PM
Re: shorttags viza HTML 0 07-24-2008 05:51 AM