【问题标题】:browser stuck when use phone gap with jQuery mobile使用 jQuery 移动电话间隙时浏览器卡住
【发布时间】:2014-12-13 06:53:00
【问题描述】:

我正在尝试开发 phoneGap、jquery 移动应用程序,在我导入 jquery mobile 之前,我的页面运行正常,当我导入 jquery mobile 并运行 index.html 时,我得到了这些弹出窗口

当我点击确定时,我得到了

当我点击确定时,页面卡住了,当我在 fireFox 上运行时,我也得到了

我的项目文件夹屏幕截图(查看我的文件)

有人可以帮忙吗?

我的 index.html

 <!DOCTYPE html>
    <!--
        Copyright (c) 2012-2014 Adobe Systems Incorporated. All rights reserved.

        Licensed to the Apache Software Foundation (ASF) under one
        or more contributor license agreements.  See the NOTICE file
        distributed with this work for additional information
        regarding copyright ownership.  The ASF licenses this file
        to you under the Apache License, Version 2.0 (the
        "License"); you may not use this file except in compliance
        with the License.  You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

        Unless required by applicable law or agreed to in writing,
        software distributed under the License is distributed on an
        "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
         KIND, either express or implied.  See the License for the
        specific language governing permissions and limitations
        under the License.
    -->
    <html>
        <head>
            <meta charset="utf-8" />
            <meta name="format-detection" content="telephone=no" />
            <meta name="msapplication-tap-highlight" content="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="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
            <link rel="stylesheet" type="text/css" href="css/index.css" />
            <link href="jQueryMobile/jquery.mobile-1.4.5.min.css" rel="stylesheet" type="text/css" />
            <script src="js/jquery.js" type="text/javascript"></script>
            <script src="jQueryMobile/jquery.mobile-1.4.5.min.js" type="text/javascript"></script>
            <title>Hello World</title>
        </head>
        <body>


          <!--
            <div class="app">
                <h1>PhoneGap</h1>
                <div id="deviceready" class="blink">
                    <p class="event listening">Connecting to Device</p>
                    <p class="event received">Device is Ready</p>
                </div>
            </div>
            -->

            <div data-role="header">

             <h1>Your resource app</h1>

            </div>

            <div dara-role="content"> 

                    <a href="page2.html" data-role="button" data-rel="back" data-theme onclick="myFunction()">Go</a>


            </div>

             <div dara-role="footer">   

                <h4>&copy; carsRent.ps</h4>

            </div> 

             <script>
            function myFunction() {
                window.alert("fff");
            }
            </script> 
            <script type="text/javascript" src="cordova.js"></script>
            <script type="text/javascript" src="js/index.js"></script>
            <script type="text/javascript">
                app.initialize();
            </script>


        </body>
    </html>

【问题讨论】:

    标签: javascript jquery cordova jquery-mobile


    【解决方案1】:

    不要点击确定。按 Escape 键或单击取消。

    当我使用 PhoneGap 进行开发时,我通常会注释掉 PhoneGap 的脚本链接,这样我就不会看到那些弹出窗口。

    在你的情况下注释掉这一行:

    <script type="text/javascript" src="cordova.js"></script>
    

    确保在部署到设备之前取消注释该行。

    【讨论】:

      【解决方案2】:

      您无法在浏览器中对其进行测试。您需要在您的 android/ios 模拟器和实际的手机设备中对其进行测试。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2018-07-04
        • 1970-01-01
        • 2020-06-03
        • 2014-12-31
        • 1970-01-01
        • 1970-01-01
        • 2013-02-06
        相关资源
        最近更新 更多