2012-03-19 4 views
0

I have this code:JqueryMobileとAndroid 4.0 <a href="page1.html"... don´t work.

$('#list').append('<li><a href="page1.html?id=1" data-transition="pop"><h3>Title</h3><p>Description</p></li>');

It's working fine in Android 2.3.. but in Android 4.0.3 I get "error loading page".

I'm using phonegap 1.3 and jquery mobile.

page1.html is a local file in assets/www/page1.html

This is the Index.html code:

<div data-role="page" id="idpage"> 
    <div data-role="header">   
     <h1>Tittle</h1> 
    </div> 

    <div data-role="content">  
     <ul id="list" data-role="listview" data-filter="false" data-filter-theme = "a" ></ul>         
    </div> 

    <div data-role="footer"> 
     <h1>Footer</h1> 
    </div> 
    </div> 

Thanks and sorry for my English.

+0

使用しているjQMobileのバージョンは何ですか?私はjQMobile 1.0.1でPhoneGap 1.5を使用しています。ページナビゲーションは正常に動作します。 – codemonkey

答えて

0

There was a bug introduced in Honeycomb that persists into Ice Cream Sandwich where loading a file from the assets directory into a WebView will fail if the URI contains a query string or a fragment (#).

See this issue for more details: http://code.google.com/p/android/issues/detail?id=17535

解決策の1つは、ファイルをアプリの内部ストレージディレクトリにコピーし、そこからロードすることです。

+0

ありがとう、私はonclickイベントを使用するつもりです。 – Pelmazote