2012-03-19 41 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?我正在使用PhoneGap 1.5和jQMobile 1.0.1,並且頁面導航工作正常。 – codemonkey 2012-03-19 14:21:27

回答

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

一種解決方法是將文件複製到應用程序的內部存儲目錄並從那裏加載它們。

+0

謝謝,我將使用onclick事件。 – Pelmazote 2012-03-19 20:28:32