I have 20 pages, each page contains 30 li
tags like below,
<li id="1">1<li/>
<li id="2">2<li/>
<li id="3">3<li/>
<li id="4">4<li/>
<li id="5">5<li/>
...
I would fire an ajax(.getJSON())
call like multi thread for each li
tag,
I did this one using the following jQuery code, but it is one by one ajax (.getJSON) calls,
it takes 2 seconds (business logic + presentation logic) to complete one ajax call. To load total page it is taking 60sec (2x30).
jQuery(li).each(function(e) {
jQuery.getJSON(JSonUrl,{},
function(json) {
// AJAX Response.
if (json == null) {
} else {
var jsonList = json.deviceStatusString.split(',');
var jsonInnerList = jsonList[0].split('#');
...
}
}
);
});
Could you please help me to fire all ajax calls like java multi thread?