So the page keeps freezing when i run this function on firefox and google chrome i tried using a for loop didn't work as expected any ideas?
Thanks
function grab_users() {
var start_id = document.getElementById('start_range');
start_id = start_id.value;
var end_id = document.getElementById('end_range');
end_id = end_id.value;
var grabbed = document.getElementById('grabbed_users');
while (start_id < end_id) {
$.ajax({
url: "php/extract.php",
type: 'GET',
data: {'start_range': start_id},
success: function(res) {
var usernames = res;
if (!usernames.valueOf() == "") {
usernames = usernames.replace('</br>', '');
grabbed.value += usernames + '\n';
}
}
});
start_id+=1;
}
}
grabbedfrom inside the callback...start_idis a string, and adding1doesn't do what the OP thinks