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't get it. I will appreciate any help.
Here is my $.ajax request.
$.ajax({
url: '<?php bloginfo('template_directory'); ?>/ajax/product.php',
type: 'get',
data: {product_id : product_id},
beforeSend: function(){
$('#details').html('<div class="loading"></div>');
},
success: function(data){
$('.iosSlider').fadeOut('fast');
thisprod.addClass('current');
$('#details').css({opacity: 0}).html(data).stop().animate({left: 0, opacity: 1}, 800);
}
});
return false;