jQuery AJAX action for each LI

MW

New Member
I'm currently creating an update script, whereby I have a list of tasks each detailed in a UL, example below:\[code\]<ul id="tasks"><li id="task1">Task one</li><li id="task2">Task two</li><li id="task3">Task three</li></ul>\[/code\]I'm looking for a way for jQuery to systematically loop through each li and perform an AJAX request for each specific ID. More specifically, I'd like to do this automatically (without user interaction) performing each individual request in order... e.g when li#1 is finished, it'll start on the next.I can loop through each li by using the following, but I can't see to get the AJAX to automatically perform its request\[code\]$('li').each(function(index) { task = $(this).attr('id'); /* perform the task */ });\[/code\]Can anyone help?
 
Back
Top