-
Notifications
You must be signed in to change notification settings - Fork 69
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
Not an issue actually but the request to provide more advanced example #66
Comments
Hi @aefimov64 As per the pagebeforechange event, I'll probably remove the support from the router, because (but this is only my opinion) it shouldn't be used in normal applications, at least without very good reasons. |
Thanks a lot for your feedback! I do really want this event (pagebeforechange) to be supported by your excellent plugin. Just one example to illustrate why do I need it. May be you will like this idea too :) I want page structure in the app to be as much flexibility as possible. Even more I want this structure to be downloadable from my server. I also want my app to be launched with "blank" body because I cannot predict page structure that I will receive on app start from the server! Armored with your plugin I'm going to setup a set of routers that will help me to intercept pagebeforechange events to populate blank body with requested jQM page on the fly and then navigate to it. This is why I need pagebeforechange event. So the sequence is:
|
I've done some applications that are just like what you've just described but I used a different approach. Basically what you're trying to do is already done by jquery mobile itself when you use the single page template in "ajax mode". The html that is fetched from the server can be a simple skeleton and may contain underscore templates, which is very useful to keep the javascript tidy and avoid long strings that contain html code. I find this really useful. There are, however, some edge cases where you want to append the page yourself, without fetching anything from the server. The only limit of this technique is that you have to follow these simple rules:
Hope this is somehow useful. |
Dear Andrea,
It would be great if you provide more advanced example that demonstrates the whole power of your plugin. I.e. an example that intercepts ALL jQM page events starting from the beginning.
For me, I'm struggling with proper configuration of the router to intercept pagebeforechange event when first jQM page located in my index.html is processed/displayed by jQM. Everething is fine when I start navigating to other pages. I can intercept the whole bunch if events.
The text was updated successfully, but these errors were encountered: