|
Posted by Richard Cornford on December 5, 2006, 5:08 am
Please log in for more thread options
Andy Fish wrote:
> I would like to include extra "hidden" information in a generated HTML page
> that can be used by javascript functions.
>
> I realise that most browsers seem to ignore any tags and attributes they
> don't understand, but from what I can tell the standards do not allow me to
> make up my own tags or attributes as they will fail validation.
>
> is there any standard element name that can be used for such a purpose i.e.
> passes validation but never produces any output (and ideally allows nested
> elements to be rendered normally too)
If you want to put extra data into a web page for use by javascript why
not put it inside a SCRIPT element, probably in a structure made up of
Array and Object literals (as anything that can be represented with a
mark-up tree can also be represented in such a form).
Richard.
|