Re: Over-tidying <TR>'s

Thanks for your responses, everyone.  Now that I figured out how to read
the DTD, I see that my HTML is illegal, and I'll be sure to fix it.

Thanks!!

--susan




                    Dave Raggett
                    <dsr@w3.org>          To:
susan_levine@peoplesoft.com
                    Sent by:              cc:     html-tidy@w3.org,
ac.quick@sympatico.ca
                    html-tidy-requ        Subject:     Re: Over-tidying
<TR>'s
                    est@w3.org


                    01/18/00 01:13
                    AM







On Mon, 17 Jan 2000 susan_levine@peoplesoft.com wrote:

> Hi Tidy People--
>
>
> Tidy doesn't like script tags inside a <tr>.  It chooses to move it to
> before the <table> tag.  The problem is that my <script> tag references
an
> image defined above it using the javascript DOM, so that when it's moved
to
> before the table, it gets an undefined object error when it executes.  I
> can't find anything in the HTML spec that specifically prohibits the
> <script> tag from living within the <tr> (or any other tag).  I believe
my
> HTML is correct, and Tidy is providing an unnecessary clean up.
>
> Is this something you can (or would be willing to) fix, or is there some
> specification that says script tags can only be defined within the <body>
> tag?
>
> I am actually experiencing this problem with the Java version of Tidy,
but
> Andy Q. does not want to deviate from your functionality.
>
>
>
> My HTML looks like this:
>
> <table>
>     <tr>
>         <td>
>             <IMG WIDTH=240 HEIGHT=20 NAME=processing src='IMAGE1.gif'>
>         </td>
>         <SCRIPT LANGUAGE='javascript'>
>           document.processing.src = 'IMAGE2.gif';
>         </SCRIPT>
>
>     </tr>
> </table>

This is indeed illegal. The simplest fix is to move the script into
the table cell. You could also rewrite your script to avoid the
processing error.

Tidy isn't smart as a human and doesn't have enough common sense to
"know" that this is a good thing to do. For instance, it doesn't
understand hardly anything about JavaScript.

Regards,

-- Dave Raggett <dsr@w3.org> http://www.w3.org/People/Raggett
tel/fax: +44 122 578 3011 (or 2521) +44 385 320 444 (mobile)
World Wide Web Consortium (on assignment from HP Labs)

Received on Friday, 24 March 2000 13:15:24 UTC