W3C home > Mailing lists > Public > www-validator@w3.org > January 2019

Re: False warning in HTML5 verifier

From: Taylor, P <P.Taylor@rhul.ac.uk>
Date: Tue, 22 Jan 2019 09:07:19 +0000
To: Steve Glennie-Smith <sgs@stevegs.com>
CC: "www-validator@w3.org" <www-validator@w3.org>
Message-ID: <0afcfba0-f4da-b73e-8100-37ac34148a8c@Rhul.Ac.Uk>
The verifier really cannot be expected to look inside scripts.  The following might pass verification and is cleaner.

    document.write ('   <th colspan="3">Tax:');
    if (overpaid)
        document.write (' overpaid<\/th><td class="red">');
        document.write (' due<\/th><td class="total">');
    var amount = 40.73;
    document.write ('&pound;' + amount + '<\/td>');

If that too fails, write the opening and closing <tr> tags within the script as well.
Philip Taylor
Received on Tuesday, 22 January 2019 09:07:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:00:08 UTC