Can someone show me a practical example on setting a timeout to my $.ajax request and redo the entire request if the first request is timed out, I\'ve read the docs and didn
Try this
var setTime = setTimeOut(function() {
$.ajax({
url: '/ajax/product.php',
type: 'GET',
data: {
'product_id': product_id
}
}).beforeSend(function() {
$('#details').html('');
}).done(function(data) {
$('.iosSlider').fadeOut('fast');
thisprod.addClass('current');
$('#details').css({
opacity: 0
}).html(data).stop().animate({
left: 0,
opacity: 1
}, 800);
});
}, 2000);