Wednesday, February 20, 2013

jQuery mobile blank page on navigate on android

This situation happen when the app requires an inner ajax page loading without refresh the page.

It seems that when one of the inner div is long (especially with listview), any navigation to a short page might trigger a blank page issue.

We aren't sure if this is android browser issue, or jquery mobile issue.
The solution is to scroll to the top before showing the new page (especially short page).

To scroll to the top:

jQuery.mobile.silentScroll(0);


Example:
jQuery.mobile.silentScroll(0);
jQuery("#content > div").hide();
jQuery("#content #mypage").show();


No comments: