简体   繁体   中英

browser stuck when use phone gap with jQuery mobile

i am trying to develop phoneGap, jquery mobile app , before i imported jquery mobile my page was running normaly, byt when i imported jquery mobile , and run index.html i got these popups

在此处输入图片说明

when i clik OK i got

在此处输入图片说明

and when i click OK the page stuck , and when i ran this on fireFox i also got

在此处输入图片说明

my project folder screen shot (to see my files)

在此处输入图片说明

can any one please provide any help?

my 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>

Don't click Ok. Press the Escape key or click Cancel.

When I'm doing development with PhoneGap I usually comment out the script link to PhoneGap so that I don't get those pop ups.

In your case comment out this line:

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

Make sure to uncomment the line before deploying to device.

You can't test it in your browser. You need to test it inside your android/ios emulator and actual phone device.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM