Possible Duplicate:
jquery $.ajax timeout setting
The timeout works, but when the timeout occurs, I want to execute a function. do you have any ideas how to do this?
$.ajax({
type: "GET",
url: "xajax.php",
timeout: 100,
data: "name=John&location=Boston",
success: function(msg) {
alert( "Data Saved: " + msg );
}
});
Use complete:
or error:
Here is an example using complete: