Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pagebeforechange doesn't work with JQM 1.1.1 #53

Open
joanscript opened this issue Jul 13, 2012 · 5 comments
Open

pagebeforechange doesn't work with JQM 1.1.1 #53

joanscript opened this issue Jul 13, 2012 · 5 comments

Comments

@joanscript
Copy link

That is, the router doesn't work with the new version of the jQuery Mobile.
Could u please have a look on this issue?
Thanks

@azicchetti
Copy link
Owner

Hi,
I've not yet tested it extensively (I'm quite busy atm), but it seems to work as expected, at least for the most basic test cases under the examples/ directory (jquery mobile 1.1.1, jquery 1.7.1).

Please provide some code if you find that something is off.
Thank you!

@joanscript
Copy link
Author

For example, u can test the /test-bC.html. If u are on #localpage4 page and reload it, the index appears.

@azicchetti
Copy link
Owner

Uh, the pagebeforechange event...

For that specific test-case, it seems a jquery mobile bug to me but I've not yet debugged anything.

However, I wouldn't recommend using that event from the router because it breaks other useful routes and somehow conflicts with the router itself.

If you need to inject pages into the dom by hand, switch to a "fake" ajax approach, disable pushState and use the pagebeforeload event.

In case this approach is not of your liking, I suggest you attach a pagebeforechange handler before the router javascript file is loaded and take things over from that point.

@joanscript
Copy link
Author

I see what u mean, but for example if I do your last point, which seems quite ok, I might not need the plugin, don't u think?
Anyway, and as u commeneted , after doing some more tests with the pagebeforechange event, it might be a jquery mobile problem!

@azicchetti
Copy link
Owner

Il 13/07/2012 16:23, joanscript ha scritto:

I see what u mean, but for example if I do your last point, which seems quite ok, I might not need the plugin, don't u think?

Yeah, it would probably be less useful but still usable for certain
events (pagebeforeshow, pagehide, etc).

I usually use the first approach for complex applications, it also keeps
the dom small due to the automatic page removal mechanism of jquery mobile.
It can be mixed with a certain number of local "hash pages" that should
be kept in the dom right from the beginning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants