2017-07-24 69 views
2

我使用的是最新版本的jQuery UI的標籤,但我得到的jQuery UI選項卡,如何解決TypeError:ui.jqXHR.error不是一個函數?

TypeError: ui.jqXHR.error is not a function

這裏下面的錯誤是我的管理標籤

$(function() { 
     $(diaise_et_id).tabs({ 

      beforeLoad: function(event, ui) { 
       ui.jqXHR.error(function() { 
        ui.panel.html(
         "Couldn't load this tab. Please check your internet connection or connection to the server. " + 
         "Praise God forever More"); 
       }); 
      } 
     }); 

實際代碼這是我如何調用該函數

<script type="text/javascript" language="javascript"> 
pour_les_tabs("#tabs_20"); 
</script> 

我仍然看到

TypeError: ui.jqXHR.error is not a function.

可能是什麼問題以及如何解決它?

感謝

+1

http://api.jquery。 com/jquery.ajax /'棄用聲明:從jQuery 3.0開始,jqXHR.success(),jqXHR.error()和jqXHR.complete()回調被刪除。您可以使用jqXHR.done(),jqXHR.fail()和jqXHR.always()代替。「可能與您有關。 –

回答

1

jqXHR對象提供的以下方法 thendonefailalwayspipeprogressstatepromise一個子集

因此,使用到位錯誤而失敗:

ui.jqXHR.fail(function (e) { 
    // We have failed to load the tab content 
}); 
+0

你做了我的一天。非常感謝你 –

相關問題