【问题标题】:Jquery Mobile and 404 PagesJquery Mobile 和 404 页面
【发布时间】:2011-12-21 16:18:39
【问题描述】:

我正在使用 Jquery Mobile,我想知道从显示中删除错误对话框并将用户发送到实际错误页面的最佳方法。

感谢您的帮助

马特

【问题讨论】:

    标签: c# jquery asp.net jquery-mobile


    【解决方案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

    【讨论】:

      猜你喜欢
      • 2011-12-28
      • 1970-01-01
      • 2013-01-31
      • 2012-02-25
      • 1970-01-01
      • 1970-01-01
      • 2014-09-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多