I have jquery.ajax that requesting some records to my database.,the problem is if it is always requesting data,and tried to click some navigation menu,It can’t navigate to other page it is very slow.when I tried to comment the method inside my success,it works fine I can navigate because there is no request pending but how can I make this work to request then I can navigate.
Thank you in advance.
$(function(){
Updates();
});
function Updates(){
type: "GET",
dataType:'json',
url: "updates.php",
error: function () {
setTimeout(Updates, 5000);
},
success: function(data){
//do something with the data
...
...
...
Updates(); //call again the function
}
});
}