Yes something like this:
$ajax(blah blah){}
success: {do this}
error: function() {alert: "No comms"}
I think I got that about right, the ajax function if theres an error runs the ;error:' line, and if theres an interval command setup it'll do so every time if the ajax fails, clogging up the browser with alerts.
I'm pretty sire now the browser que's the alerts, so adapting to send just one is a good idea methinks, then you dont have to close the browser to get the page back.