浏览器在与jQuery mobile使用手机差距时卡住了

时间:2014-12-13 06:53:01

标签: javascript jquery cordova jquery-mobile

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

enter image description here

当我clik OK我得到了

enter image description here

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

enter image description here

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

enter image description here

任何人都可以提供任何帮助吗?

我的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>

2 个答案:

答案 0 :(得分:1)

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

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

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

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

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

答案 1 :(得分:0)

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