Use a timeout value that is shorter than your refresh interval. When the request expires, it is called by the error handler, so you will need to distinguish between time errors and other types of errors in the handler.
$.ajax({
type: "POST",
url: "some.php",
data: "name=John&location=Boston",
timeout: 5000,
success: function(msg){
alert( "Data Saved: " + msg );
}
});
Docs on jquery.com. The example above is from the same source, but with a timeout value added.