Browse Source

错误不刷新题目

mzx16822 6 years ago
parent
commit
f621b8bb08
1 changed files with 4 additions and 1 deletions
  1. 4 1
      resources/views/home/user.blade.php

+ 4 - 1
resources/views/home/user.blade.php

@@ -283,7 +283,10 @@ layui.use(['form','jquery'], function(){
   //获取题目
   var getQuestion = function getQuestion(room_id, index) {
     var url = '/Home/Game/Question';
-    $.get(url, {room_id:room_id, cur_question:index}, function(responsedata){
+    $.get(url, {room_id:room_id, cur_question:index},ajaxError:function(){
+      clearInterval(ts)
+      layer.msg("服务器繁忙!"); 
+    }, function(responsedata){
       if(responsedata.code == 0){
        question_id= responsedata.info.question.question_id;
         $("#Jqtitle").html(responsedata.info.question.title );