【问题标题】:"loading" div automatically appended when using cordova (phonegap)使用cordova(phonegap)时自动附加“加载” div
【发布时间】:2012-11-12 16:58:52
【问题描述】:

我正在使用 cordova 在 android 平台上进行移动应用开发。 我在 www/index.html 文件中有这个 html 代码:

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Language" content="en" />
    <script src="cordova-2.2.0.js" type="text/javascript"></script>
    <script src="jquery/jquery.js" type="text/javascript"></script>
    <script src="jquery.mobile/jquery.mobile-1.1.0.js" type="text/javascript"></script>
    <script src="JS/main.js" type="text/javascript"></script>
    <link rel="stylesheet" href="CSS/main.css"/>

</head>
    <body id="body" class="body">
        <div id="box" class="bodyBlack">
        </div>
    </body>
</html>

我不知道为什么,但是当我运行这个应用程序时(也只是在 PC 浏览器上打开时),我在页面底部附加了这个 div:

<div ui-loader ui-corner-all ui-body-a ui-loader-default>
    <span ui-loader ui-corner-all ui-body-a ui-loader-default></span>
        <h1>loading</h1>

这是main.js的内容:

$(document).ready(function(){
    $('#box').click(function(){
        if($(this).attr('class') == 'bodyBlack'){
            $(this).removeClass('bodyBlack');
            $(this).addClass('bodyWhite');
        }
        else{
            $(this).removeClass('bodyWhite');
            $(this).addClass('bodyBlack');
        }
    });
});

为什么以及从哪里获得剂量?我如何阻止它这样做? 谢谢!!!

【问题讨论】:

    标签: android cordova jquery-mobile mobile


    【解决方案1】:

    这似乎是 jQuery Mobile 生成的“加载消息”,请参阅 this answer。所以 jQuery Mobile 正在加载一些东西(也许找不到它)。如果您仍然遇到问题,请发布您的 main.js 文件的内容!

    【讨论】:

    • main.js 现在是问题的一部分
    • 好的,看来 jQuery Mobile 正在尝试默认加载某些内容。我已经有一段时间没有使用它了,所以我不确定它到底是什么,但 div 肯定是由 jQM 生成的!
    • 我在你给我的链接中找到了解决方案
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多