I\'m working on a web application that uses ajax to communicate to the server. My specific situation is the following:
I have a list of users lined out in the html p
To answer the question of "how to get it into the document in the first place", I suggest a layout similar to this:
- Some Username
- Some Username
This allows you to easily select a lot of info about your users:
$('#users > li') // all user elements
$('.someStatus') // all users of a particular status
Then in your event handlers it's also easy to get the current status:
$(this).attr('class') //get current status once you have a user element selected.
Another alternative is to dump javascript to the page and simply have it use the jquery data functionality to store the data as soon as the page loads. You'd still need an id on the element in order to find the right one though.