Open jcalonso opened 10 years ago
Thanks, this helped me out today.
I've had a similar issue, which I resolved by making my vendored jquery.mobile
depend on jquery.mobile.router
:
https://github.com/wq/wq.app/blob/master/js/jquery.mobile.js#L16
It would be nice to figure out a way to get around this ordering issue - how important is the mobileinit
hook?
This is not an issue, I just want to share my solution for this problem that took me a while to figure out how to fix.
The problem can be common, there are some people reporting issues with the router being initialized 'late' after jQuery mobile events happened. I tried to create the JQM router as soon as possible but still wasn't able to do it before the page events trigger.
The solution was very simple, just disabled the
autoInitializePage
option like this:And then after initialising the router call it manually.
Here is a simple example:
The main.js
The app.js
The router.js
The jquerymobile.config.js