Phonegap HTML app and various alerts hang browser

前端 未结 3 581
刺人心
刺人心 2021-01-31 02:12

When testing phonegap app, I get the following three alerts and the browser just hangs. Running app from server. Many times these alerts popup before the Ripple plugin can sta

相关标签:
3条回答
  • 2021-01-31 02:55

    If you're testing your app in your desktop browser, you can simply exclude the file. For Chrome:

    <script type="text/javascript">
        if (!navigator.userAgent.toLowerCase().match('chrome')) {
            document.write("<script src='phonegap.js'><\/script>");
        }
    </script>
    

    (This way you don't have to remember to uncomment the script link for your build process.)

    0 讨论(0)
  • 2021-01-31 02:57

    Those alerts normally show up when you have the wrong cordova.js file included. There are different ones for each platform. Make sure that you havn't for example copied the android one into your ios build.

    0 讨论(0)
  • 2021-01-31 02:57

    You just need to comment out this line on cordova.js :

    return prompt(argsJson, 'gap:'+JSON.stringify([service, action, callbackId]));

    which is on line 4184 when using Phonegap 2.9.0-0 (Android)

    Uncomment before deploying to the device for production

    0 讨论(0)
提交回复
热议问题