228
$.ajax({
url: "test.html",
error: function(){
//do something
},
success: function(){
//do something
}
});
Sometimes success function works good, sometimes not.
How do I set timeout for this ajax request? In example, 3 seconds, if time is out, then show an error.
The problem is, ajax request freezes the block until finishes. If server is down for a little time, it will never end.