A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.
To request an account, ask an autoconfirmed user on Chat (such as one of these permanent autoconfirmed members).
CustomData: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
== Candidates == | == Candidates == | ||
<pre> | <pre> | ||
<span | <span data-thing="50" data-my-doohickey="4,5,1,2">bla bla</span> | ||
if (span.dataset.thing > 10) { ... } | |||
span.dataset.doohickey = '1,2,3,4'; | |||
</pre> | </pre> | ||
== Rejected == | |||
<pre> | <pre> | ||
<span custom | <span custom:my-thing="50" custom:my-other-thing="4,5,1,2">bla bla</span> | ||
</pre> | </pre> | ||
<pre> | <pre> | ||
<span | <span custom-my-thing="50" custom-my-other-thing="4,5,1,2">bla bla</span> | ||
</pre> | </pre> | ||
<pre> | <pre> | ||
<span><param name=my-thing value="50"><param name=my-other-thing value="4,5,1,2">bla bla</span> | <span><param name=my-thing value="50"><param name=my-other-thing value="4,5,1,2">bla bla</span> | ||
</pre> | </pre> |
Revision as of 06:23, 28 March 2008
Here are some ideas for how to include custom data in HTML documents.
Candidates
<span data-thing="50" data-my-doohickey="4,5,1,2">bla bla</span> if (span.dataset.thing > 10) { ... } span.dataset.doohickey = '1,2,3,4';
Rejected
<span custom:my-thing="50" custom:my-other-thing="4,5,1,2">bla bla</span>
<span custom-my-thing="50" custom-my-other-thing="4,5,1,2">bla bla</span>
<span><param name=my-thing value="50"><param name=my-other-thing value="4,5,1,2">bla bla</span>