$.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.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…