W3C home > Mailing lists > Public > www-validator@w3.org > July 2016

Re: How TO - Include HTML

From: David Dorward <david@dorward.me.uk>
Date: Tue, 12 Jul 2016 15:44:17 +0100
To: "V G Woodhouse" <vgw@vgwoodhouse.co.uk>
Cc: www-validator@w3.org
Message-ID: <732265AA-F80E-46A5-9A86-7730E88CCF7A@dorward.me.uk>
On 8 Jul 2016, at 17:46, V G Woodhouse wrote:
> Error: Attribute w3-include-html not allowed on element div at this point.

> I have used code equivalent to w3schools example, reproduced below,  and have been unable to clear validation.

W3Schools are awful (and not related to the W3C) and the guide you followed requires you to write invalid HTML.

HTML 5 provides [data attributes][1] for this kind of extension, and the script you are using should have been written to use them.

I'd recommend against using client side JavaScript for this sort of thing and pick a solution that runs either server side or with a preprocessor at build time.

[1]: https://www.w3.org/TR/html5/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes

-- 
David Dorward
http://dorward.co.uk/

Received on Tuesday, 12 July 2016 14:44:46 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 12 July 2016 14:44:48 UTC