Phonegap + JQM:Android上的本地文件的问题 [英] Phonegap + JQM: problems with local files on android

查看:104
本文介绍了Phonegap + JQM:Android上的本地文件的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是一个常见的问题,但我很难理解
基于我所看到的各种答案的结果。

I know this is common question, but I having a hard time understanding my results based on the various answers I have seen.

我有一个phonegap + jquery移动应用程序使用几个本地html文件。
层次结构看起来像这样

I have an phonegap + jquery mobile application that is using several local html files. The hierarchy looks like this

index.html
  |
  --- A.html  (uses getJSON() to server to get list)
  |     |
  |     --- A1.html  (uses getJSON() to server to get details)
  |
  --- B.html  (uses getJSON() to server to get list)
        |
        --- B1.html    (uses getJSON() to server to get details)

html和js assets是本地的。我使用jquery mobile。

html and js assets are local. I am using jquery mobile.

在黑莓手机上一切正常。在Android上,index.html,A.html,
和B.html工作正常。当尝试访问详细信息视图A1和
B1时,我收到错误加载页面。

Everything works fine on blackberry. On android, index.html, A.html, and B.html work fine. When trying to access the details views A1 and B1, I get "Error Loading Page".

我不明白为什么A和B工作, A1和B1没有。

I can't understand why A and B work, but A1 and B1 don't.

虽然不知道为什么这会有所作为,但从另一个
线程,我发现了一个建议添加

Although not sure why this would make a difference, from another thread I found a suggestion to add

android:configChanges="orientation|keyboardHidden"

添加到清单中的活动。

to the activity in the manifest. This didn't change anything.

如果是jquery相关的,我尝试添加以下内容:

In case it is jquery related, I tried adding the following:

$( document ).bind( "mobileinit", function() {
    // Make your jQuery Mobile framework configuration changes here!
    $.mobile.allowCrossDomainPages = true;
    $.support.cors = true;
});

还是没有爱。关于如何修复或调试此问题的任何想法?

Still no love. Any ideas on how to fix or debug this?

感谢,
Aaron

Thanks, Aaron

推荐答案

此问题与在网址中传递数据时导致错误的网页视图错误相关。

This problem is related to a webview bug that causes an error when passing data in the URL.

http://code.google.com/p/android/issues/detail?id=17535

从A到A1的网址看起来像A1.html?id = 1,其中?id = 1是导致问题的原因。

The URL from A to A1 looks like A1.html?id=1 where the ?id=1 is causing the problem.

干杯。

这篇关于Phonegap + JQM:Android上的本地文件的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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