Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


$.mobile.activePage empty/incorrect in 'pageinit' #3384

nisc opened this Issue · 4 comments

4 participants


$.mobile.activePage does not become available before the pagebeforeshow event has fired.

It is empty/incorrect in pagecreate, pageinit, etc.

This makes my life pretty hard. Given the current structure of my project, I have to resort to doing one-time stuff in pagebeforeshow (which gets executed multiple times), because I need a reference to the current page.

This slows my application down and causes flickering.



Not sure if it would work for your project, but here's how I got around the same issue:

$('.ui-page, .ui-dialog').live('pageinit', function(event) {
    var $cur_page = $(this);
    // do stuff with current page...

Alternatively you could handle the event any way you want and just use to get a reference to it:

$(document).bind('pageinit', function(event) {
    var activePage = $(;

That was easy, thanks. So it should be trivial to fix .activePage.


Sounds like you've found your solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.