jquery - 禁用 jQuery Mobile 加载消息和 AJAX

标签 jquery jquery-mobile

我附加了常规 jQuery 库,并在 (jquery.mobile-1.2.0.min.js) 之后附加了 jQuery 移动文件。

一旦我附加 jQuery mobile 并刷新页面,我就会看到加载屏幕。

我尝试通过以下方式禁用它:

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

以及尝试不同的初始化函数:

$(document).bind('pageinit'){

但两者都不起作用。我仍然只是收到加载消息或完全空白的屏幕。

我真正需要它的唯一功能是滑动事件。

提前致谢。

最佳答案

Mobileinit必须在引入jQM js文件之前使用,如下所示:

<head>
    <title>jQM Complex Demo</title>
    <meta name="viewport" content="width=device-width"/>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
    <script>
    $(document).on("mobileinit", function(){
        $.mobile.ajaxEnabled=false;
        $.mobile.loadingMessage = false;
    });            
    </script>
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>    
</head>

如果在脚本加载后执行它,它将不起作用。

关于jquery - 禁用 jQuery Mobile 加载消息和 AJAX,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14602919/

相关文章:

在asp.net mvc 5中连接到远程数据库时jquery ajax调用失败

javascript - jQuery Mobile 没有样式化附加元素

javascript - Mustache.js - 使用 $get() 获取外部模板数据时出现问题

android - 您使用 RhoMobile + JqueryMobile + KnockoutJS 的体验如何?

jquery - jQuery 中的链式选择器

javascript - 从 Javascript Datepicker 获取工作日名称

php - 每次使用 window.location 时 iframe 都是嵌套的

javascript - 输入范围 每份表格仅限一个

javascript - jQuery 管理多个 Ajax 调用结果

javascript - 与 jquery mobile 一起使用时的 d3js 条形图问题