可以用jQuery中的ajax超时判断:
$.ajaxSetup({ timeout: 1, // 1秒超时 error: function(request, status, maybe_an_exception_object) { if(status == 'timeout') alert("网断了"); }});