Re: shorttags

Discussion in 'HTML' started by RobG, Jul 25, 2008.

  1. RobG

    RobG Guest

    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
    XHTML.

    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.


    --
    Rob
     
    RobG, Jul 25, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Morten Holt

    Re: shorttags

    Morten Holt, Jul 23, 2008, in forum: HTML
    Replies:
    9
    Views:
    482
    Stevo
    Jul 24, 2008
  2. viza

    Re: shorttags

    viza, Jul 24, 2008, in forum: HTML
    Replies:
    0
    Views:
    419
  3. Andy Dingley

    Re: shorttags

    Andy Dingley, Jul 24, 2008, in forum: HTML
    Replies:
    4
    Views:
    420
    Gus Richter
    Jul 25, 2008
  4. BootNic

    Re: shorttags

    BootNic, Jul 24, 2008, in forum: HTML
    Replies:
    2
    Views:
    415
    Thomas 'PointedEars' Lahn
    Jul 25, 2008
Loading...

Share This Page