Right now, what i'm trying to do is display some lists on a page and pull out that information from the server using Jquery. The code looks like:
<div class="list" name="category1" />
<div class="list" name="category2" />
<div class="list" name="category3" />
....
$(".list").ready(function(){
$.post("/getData", "{name=category#}"
function(data) {
// Do something here to display the list
}
);
});
Assuming that /getData returns the needed ul .... /ul html data, how do I go about replacing the text in the divs with the data sent back? I tried different variations of $this.html(data) with no luck. Also, is there a way to select the name of the div to send back as a .post parameter?