现在的位置: 首页 > 综合 > 正文

JQueryMobile的Error Loading Page问题的解决

2013年09月12日 ⁄ 综合 ⁄ 共 492字 ⁄ 字号 评论关闭

默认情况JQUERY MOBILE会捕获对链接点击的事件,试图通过AJAX的方式载入目标页面。但如果目标页面是302重定向的方式,则会弹出Error Loading Page的错误。
折腾了很久,也尝试通过

            $(document).bind("mobileinit", function(){

                 $.mobile.ajaxEnabled=false;

            });
来禁止之,但一直无效。
最后找到一段话:
To disable pages loading through Ajax bind 'mobileinit' and override $.mobile.ajaxEnabled (You need to bind 'mobileinit' before referencing the jQuery mobile script) or add data-ajax="false" or rel="external" to the link element.

添加了之后一切OK。

转载地址:http://hi.baidu.com/goldchocobo/item/13596a367ef4c0f72784f4fe

抱歉!评论已关闭.