diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js index ca120df2f..f488465ca 100644 --- a/public/javascripts/homework.js +++ b/public/javascripts/homework.js @@ -92,7 +92,14 @@ $(function(){ test_post(i+1); } - ); + ).fail(function(xhr, status){ + if(status == 'timeout'){ + alert("您的答案超时了, 请检查代码是否存在死循环的错误."); + } else { + alert("测试失败,服务器出错."); + return; + } + }); }; test_post(1);