Created
June 5, 2011 10:02
-
-
Save hkulekci/1008839 to your computer and use it in GitHub Desktop.
JQuery Recursively Ajax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function recursively_ajax(active_num,end_num){ | |
var number = 0; | |
if (active_num == end_num) return; | |
$.ajax({ | |
type:"GET", | |
url: "pages.php", | |
data: "p="+active_num, | |
success: function(data){ | |
$('.printable_area').addClass("done"); | |
$('.printable_area').append(data); | |
number += data.find('p').length; | |
$('.printable_area').tsort("p[class]",{orderby:"class"}); | |
number += recursively_ajax(active_num+1,end_num); | |
} | |
}); | |
return number; | |
} | |
// i use normally "async: false" settings. | |
// success settings not work now to get async. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment