I need to run this function every time its work if the tab is active but in inactive tab javascript is very slow (i use chrome)
function request() {
$.ajax({
type: "GET",
encoding:"UTF-8",
url: 'request.php',
success: function(data) {
request();
}
});
}
what is solution for this problem ? I have already tested with setInterval()
Thanks you