jblas/jquery-mobile-plugins — Issue #1: Plugin does not work on first page load
Author: fiznool
Created: 2012-02-27 12:38:53+00:00
State: open

I've noticed that the plugin binds to pagebeforechange - this means that page changes initiated from a jQM control or via `$.mobile.changePage()` work fine, but a direct page refresh / load using query string params will not work.

For example, say I have a page:

`http://domain.com/index.html#lobby?user=1234`

The following will work fine:

`$.mobile.changePage('#lobby?user=1234')`

But trying to bookmark / refresh the page, as the `pagebeforechange` event never fires on initial page load, the plugin can't parse the query string.

Perhaps a quick/easy fix would be to bind to both `pagebeforecreate` and `pagebeforechange`, to catch both cases?