2011-12-21 96 views

回答

1

超載的$.mobile.pageloadfailed功能。

因此,舉例來說:

$(document).bind("pageloadfailed", function(event, data){ 

    // Let the framework know we're going to handle things. 
    event.preventDefault(); 

    // Change the page 
    if(!$.mobile.changePage('404.html')){ 
     // If it fails, call reject 
     data.deferred.reject(data.absUrl, data.options); 
    } 

}); 

jQuery Mobile docs