导航可能无法在phonegap android中出现错误 [英] navigation may not work error in phonegap android

查看:43
本文介绍了导航可能无法在phonegap android中出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Phonegap开发的新手.当我在模拟器中测试apk文件时,我已经在phonegap中为android开发了一个apk文件,这在页面末尾给了我以下错误消息

I am newbie to phonegap development. I have developed an apk file for android in phonegap when i test the apk file in emulator it is giving me the below error message at the end of the page

Note: Navigation may not work if viewed locally

The Ajax-based navigation used throughout the jQuery Mobile docs may need to be viewed on a web server to work in certain browsers. If you see an error message when you click a link, please try a different browser.

我知道其根本原因是phonegap使用file:///

I know the root cause for this is phonegap accesses the files loacally using file:///

我已经搜索过Google并尝试了解决方案,但没有解决方案

I have searched through google and tried the solution but no solution

有人可以请我帮忙吗,我在为此苦苦挣扎

Can anyone please please help me on this, I am struggling with this

这是我启用导航的脚本

<script>
$( document ).on( "deviceready", function() {
    // Make your jQuery Mobile framework configuration changes here!
alert("test")
    $.mobile.allowCrossDomainPages = true;
        $.support.cors = true;
        $.mobile.phonegapNavigationEnabled = true;
});

    </script>

推荐答案

我发现答案不确定是正确还是错误,但是消息消失了,功能正常.

I found the answer not sure whether it is correct or wrong but the message was disappeared and functionality is working fine for me.

js/index.js

index.js文件中注释此行

comment this line in index.js file

 $( document ).on( "pagecreate", function( event ) {
    $( event.target ).append( message );   #you need to comment this line
   });

这篇关于导航可能无法在phonegap android中出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆