Click here to get back home

custom tags and elements

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
custom tags and elements Andy Fish 12-05-2006
Posted by Andy Fish on December 5, 2006, 4:57 am
Please log in for more thread options


Hi,

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)

Andy





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.


Posted by Ben C on December 5, 2006, 5:31 am
Please log in for more thread options


> Hi,
>
> 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)

You can just use div in conjunction with some class name and use CSS to
set display: none for divs of that class.

div.data
{
display: none;
}

<div class="data">
...
</div>

Posted by Jukka K. Korpela on December 6, 2006, 7:50 am
Please log in for more thread options


Scripsit Ben C:

> You can just use div in conjunction with some class name and use CSS
> to set display: none for divs of that class.

Among the different suggestions that have been made, this is definitely the
worst. It would mean that any CSS-disabled user agent sees the data as
normal content. This includes search engines.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


Posted by Spartanicus on December 5, 2006, 5:38 am
Please log in for more thread options



>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)

What is it that you are actually trying to do?

--
Spartanicus

Similar ThreadsPosted
Style tags -- Eeek how obese these tags make HTML! November 8, 2006, 3:33 am
Custom meta name="xxx" October 31, 2007, 7:19 am
Custom Software Development May 20, 2007, 7:14 am
Meta Tags, Link Tags, other September 27, 2005, 3:29 pm
Adding custom attributes through XMLSchema November 4, 2005, 6:55 pm
custom January 20, 2006, 12:52 pm
xhtml, custom dtds, and MIME types January 27, 2006, 2:34 pm
Google Custom Search Engine, what type of ID? November 11, 2007, 9:02 pm
style defining custom made tag: is this portable?: x {foo: bar} Hello world July 8, 2004, 7:40 pm
Unknown Parse Mode! warning from w3c validator with custom doctype September 6, 2005, 11:23 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap