I've got an app where I populate the list from database and use it like this:
<a href="#" onClick='doSomething(object.id);'... (use the id from the object that I get from ajax-call to php-script)
for each item in the list. I could change my code to set use the id for each link like:
<a href="#" id="object.id"...
and in my vclick-event catch wich li-id that was clicked like:
$('ul[id="my_ul_id"] a').live("vclick", function (evt) {
doSomething($(this).attr('id'));
});
This works but some problem might occur in my app when several li's are used and will use same id's.
Any better ideas how to solve this problem?