【问题标题】:Phonegap (Cordova): Application not working after adding jquery mobile jsPhonegap(Cordova):添加 jquery mobile js 后应用程序无法正常工作
【发布时间】:2014-10-20 20:58:45
【问题描述】:

我是 phonegap 的新手,只是尝试使用 jquery mobile (http://nativedroid.godesign.ch) 创建一个简单的应用程序。我在玩 jquery mobile 并且工作正常,但是现在当我尝试添加 jquery mobile js 时,应用程序无法正常工作,只是显示黑屏,当我删除 JQM js 时,应用程序再次正常工作。我在浏览器中检查了应用程序正在运行的地方。我添加了正在显示的启动画面,但在模拟器中出现黑屏之后。尝试使用 jquery 和 jquery mobile 的 CDN url,但没有效果。

我在这里找到了类似的问题,但没有答案 Jquery Mobile Not working with Phonegap/Cordova

我正在使用以下简单代码:

<!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <script type="text/javascript" src="cordova.js"></script>        
        <!-- Jquery mobile -->
        <link rel="stylesheet" href="css/jquery.mobile-1.4.4.css" />
        <script src="js/jquery-1.11.1.js"></script>
        <script src="js/jquery.mobile-1.4.4.js"></script>
        <!-- Jquery mobile -->


        <title>Restaurant Name</title>
    </head>
    <body>
        <!-- Start of first page -->
        <div data-role="page" id="page1">

            <div data-role="header" data-position="fixed">
                <h1>Food Zone</h1>
            </div><!-- /header -->


            <div data-role="footer">
                <h4>Page Footer</h4>
            </div><!-- /footer -->
        </div><!-- /page -->
    </body>
    </html>

请帮我解决这个问题。我被困住了,无法继续前进。请让我知道如何调试此问题,因为我的旧应用程序在我使用 JQM 的地方工作。任何帮助将不胜感激。我正在使用所有最新版本,cordova CLI 并尝试使用 android 平台启动。

谢谢 贾亚

【问题讨论】:

    标签: android jquery-mobile cordova


    【解决方案1】:

    有时它不能在模拟器上运行,但应该在设备上运行。换个模拟器试试看。

    【讨论】:

      【解决方案2】:

      Vishwakarma,用于调试 js 错误,使用 chrome remote debugging, 如果有任何原生问题,可以通过 android sdk 提供的 android logger 解决

      【讨论】:

        猜你喜欢
        • 2014-02-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-04-26
        • 1970-01-01
        • 2020-06-24
        • 2012-05-10
        相关资源
        最近更新 更多