jQuery Mobile ajaxEnabled无法正常工作吗? [英] jQuery Mobile ajaxEnabled doesn't work?

查看:104
本文介绍了jQuery Mobile ajaxEnabled无法正常工作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正在运行最新版本的jQuery Mobile(1.0.1),并且不想使用AJAX进行页面导航.

Running latest release of jQuery Mobile (1.0.1), and do not want to use AJAX for page navigation.

我添加了以下代码,根据jQuery Mobile网站,该代码应停止使用AJAX:

I added the following code which according to jQuery Mobile website should stop the use of AJAX:

$(document).bind("mobileinit", function () {
    $.mobile.ajaxEnabled = false;
});

但是它仍然使用AJAX并将哈希(#)添加到URL.

But it still uses AJAX and adds the hash (# ) to URLs.

如何禁用AJAX?

推荐答案

只是一个猜测,但是您是否在加载jQuery Mobile之前绑定到mobileinit?

Just a guess, but are you binding to mobileinit before jQuery Mobile is loaded?

文档中所述,您需要以此顺序加载JavaScript文件:

As stated in the documentation, you'll want to load the JavaScript files in this order:

<script src="jquery.js"></script>
<script src="custom-scripting.js"></script>
<script src="jquery-mobile.js"></script>

这篇关于jQuery Mobile ajaxEnabled无法正常工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆