jquery-mobile-routerlite
jquery-mobile-routerlite copied to clipboard
routechange not firing on children with # routes
I had no idea how to create a title that would not be that cryptic ;)
$.mobile.routerlite.routechange("/", function(page, path){ console.log('!'); });
The code above logs to console on every page I visit except it doesn't log anything when I go to a page that is not loaded from a path, like: /#pageB
Is that desired? I would understand it's not a route change, but I can do:
$.mobile.routerlite.routechange("pageB", function(page, path){ console.log('hmm'); });
and it works.
Would methods like .hashchange and .onhashinit be heplful?
I guess not. I expected routechange to fire when hash changes too. And changing from / to /#pageB should also trigger a routechange for /.
I know it's difficult, because inline pages have their ids in the data-url attribute (and that's why routechange on "pageB" worked) but I think there's a way to safely guess what's the path after hash has changed.