Hi there,
another interesting feature I use very often is to extend the XHTML namespace and just use custom attributes like isDisabled, isEditable and such stuff.
At any rate, your browser will ignore these attributes and you will have access to them via getAttribute, if you want a validating xhtml file, you should also add a custom dtd file. Check this out: http://www.w3.org/TR/xhtml-modularization/dtd_developing.html

Hope this helps!

2006/9/10, Arash Yalpani < [EMAIL PROTECTED]>:
Hi Klaus,

thanks for your answer and your hint to w3! So it seems to be a common
technique. I was wondering if I am the only one doing this, but it's
good to know that I have accomplices out there ;-)

Cheers, Arash

Klaus Hartl schrieb:

>Arash, you could as an alternative use the class attribute for that, but
>theres no need to feel false about the id as well. From the HTML Spec:
>
>
>The id attribute has several roles in HTML:
>
>     * As a style sheet selector.
>     * As a target anchor for hypertext links.
>     * As a means to reference a particular element from a script.
>     * As the name of a declared OBJECT element.
>     * For general purpose processing by user agents (e.g. for
>identifying fields when extracting data from HTML pages into a database,
>translating HTML documents into other formats, etc.).
>
>The class attribute, on the other hand, assigns one or more class names
>to an element; the element may be said to belong to these classes. A
>class name may be shared by several element instances. The class
>attribute has several roles in HTML:
>
>     * As a style sheet selector (when an author wishes to assign style
>information to a set of elements).
>     * For general purpose processing by user agents.
>
>
>http://www.w3.org/TR/REC-html40/struct/global.html#h-7.5.2
>
>
>-- klaus
>
>
>
>Arash Yalpani schrieb:
>
>
>>Hi,
>>
>>this has nothing to do with JQuery directly but since the brightest
>>minds are around in this mailing list and this should be of general
>>interest...
>>
>>What I am trying to do is to pass values along with a tag, so I can use
>>that values on a mouse click or so. A short example:
>>
>><ul>
>>  <li id="li_123">Johnny</li>
>>  <li id="li_345">Nina</li>
>>  <li id="li_54">Olga</li>
>></ul>
>>
>>Now I could do something like this (pseudocode, might not work):
>>
>>$('ul>li').click(function(){
>>  var userId = $(this).attr('id').split('_')[1];
>>  $.get('doSomething.php?userId=userId');
>>});
>>
>>But it's an ugly workaround, most of the times I wouldn't want to use
>>the id-attribute like this and I am not sure if any other HTML universal
>>attribute can be used for this purpose. I have seen some other
>>implementations of this technique for tooltips for example. Stefan uses
>>it for his great Interface library where he takes the title tag's value
>>as an input for the tooltip text. It is even semantically ok:
>>
>>  <a href="" href="http://www.yahoo.com"> http://www.yahoo.com" title="Link to Yahoo">Yahoo</a>
>>
>>
>>My question is: do you use similar techniques and what benefits/problems
>>to they bring with? What are the alternatives?
>>
>>Cheers, Arash
>>
>>


--
Arash Yalpani
Entwicklung browserbasierter Software-Anwendungen

Prenzlauer Allee 173 | 10409 Berlin
[EMAIL PROTECTED] | http://www.yalpani.de


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/



--
Paul Bakaus
Web Developer
------------------------
Hildastr. 35
79102 Freiburg
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to