简体   繁体   中英

Android Browser with Phonegap and jQuery mobile

I have a strange problem. I'm developing an Android app with Phonegap and jQuery Mobile. The issue is this. I have two pages, pageA and pageB... In page A for example I have this:

<div  id="Menu" data-role="navbar">
   <a href="pageB.htm" onclick="DoSomeThink()" >Page</a></li>
</div><!-- /navbar -->

In PageB I have a script loaded in a JS file. When the page is loaded there is this event:

$('.ClassPageB').live('pageshow', function(event, ui) {
  \\Some code here
});

If I deploy this on Android phones everything is ok... But if I deploy on tablets the live.(pageshow event...) is not performed.

The only way I could resolve the problem is to put in a tag target="_self" in the link like this:

<a href="pageB.htm" onclick="DoSomeThink()" target="_self" >Page</a></li>

But if I use this I loose transition effects of JQmobile...

Any ideas?

Try loading the JS file containing:

$('.ClassPageB').live('pageshow', function(event, ui) {
  \\Some code here
});

in BOTH PageA and PageB .

Let me know if this works for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM