Marco Gasi
asked on
Looking for JQM experts!
Hi everybody.
I'm developing a mobile app using jQueryMobile and Cordova.
The app is complex enough, so I thought to use different html pages instead of the single html multipage pattern. Each page calls its javascript functions and I created some object to keep the app OOP.
The app workflow is:
the user open the app:
- index.js initilize the app and the notification plugin
- in index.html within pagecontainerbeforeshow the app instantiates User class and checks if user data are already stored in local database
- if user is already registered -> dashbord.html
- otherwise - login.html
- in login.html another instance of User is created (there's a way to share a class instance among several pages?) and the app sends email and password to the server; the server validate the user and return an array with other user details; the returned value are sotred in the local database for future authentications: finally user is redirected to the dashboard.html
- in dashboard.html other wonderful things will happen :)
Now, thins looked working fine but:
- using Chrome I see that some function is called 2 or more times even if in the code is called only once
- after the login before to go to dashboard index.html is shown again and it shouldn't
- going back to close the app and opening the app again I get a black screen and the app is loaded terribly slow; sometimes the database is empty;
I guess I'm missing something about how to structure the page but I can't find any tutorial about a non basic application. If you need to see the code, no problem: I can post here the whole stuff. I didn't post it in the question because I think the problem is not directly related to specific code but to the app structure, inclusion of files. jqm specific logic...
Any suggestion will be appreciated. Really :)
I'm developing a mobile app using jQueryMobile and Cordova.
The app is complex enough, so I thought to use different html pages instead of the single html multipage pattern. Each page calls its javascript functions and I created some object to keep the app OOP.
The app workflow is:
the user open the app:
- index.js initilize the app and the notification plugin
- in index.html within pagecontainerbeforeshow the app instantiates User class and checks if user data are already stored in local database
- if user is already registered -> dashbord.html
- otherwise - login.html
- in login.html another instance of User is created (there's a way to share a class instance among several pages?) and the app sends email and password to the server; the server validate the user and return an array with other user details; the returned value are sotred in the local database for future authentications: finally user is redirected to the dashboard.html
- in dashboard.html other wonderful things will happen :)
Now, thins looked working fine but:
- using Chrome I see that some function is called 2 or more times even if in the code is called only once
- after the login before to go to dashboard index.html is shown again and it shouldn't
- going back to close the app and opening the app again I get a black screen and the app is loaded terribly slow; sometimes the database is empty;
I guess I'm missing something about how to structure the page but I can't find any tutorial about a non basic application. If you need to see the code, no problem: I can post here the whole stuff. I didn't post it in the question because I think the problem is not directly related to specific code but to the app structure, inclusion of files. jqm specific logic...
Any suggestion will be appreciated. Really :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.