For my script I want to send few data in multiple url's
by ajax
for multiple php
query. So I tried as below which not call ajax waitForRep()
. How to do it please?
my Javascript:
var url = ['/server/server2','/server/server'];
var tutid = '<?php echo $tutid; ?>';
var CID = '<?php echo $id; ?>';
function waitForRep(){
$.each(url, function(i,u){
$.ajax({
type: "GET",
cache: false,
data: {
tutid : tutid,
CID : CID
},
timeout:15000,
success: function(data){
// do something with result
setTimeout(waitForRep, 15000 );
},
error: function(XMLHttpRequest, textStatus, errorThrown){
setTimeout(waitForRep, 15000);
}
});
}
}
$(document).ready(function(){
waitForRep();
});