EasyUI Forum

General Category => Bug Report => Topic started by: Gavin on January 02, 2014, 08:35:26 PM



Title: tabs issue
Post by: Gavin on January 02, 2014, 08:35:26 PM
when i use the tabs plugins to create a tab (for example, href="welcome.html"), but the page not exists.
in the tab content, it always "loading...", in the console, I can find the 404 error.
the question is:
how can I catch the 404 error, and do something(for example, open another page)?


Title: Re: tabs issue
Post by: stworthy on January 03, 2014, 12:03:54 AM
Please try the code below to register the error handler to the tab panel.
Code:
var t = $('#tt');
var p = t.tabs('getTab',0);  // get the tab panel
p.ajaxError(function(e,xhr){
  console.log(xhr.status);
});
p.panel('refresh','...');