Design questions for ajax application
Posted: Sun Aug 30, 2015 2:18 pm
I'm building a portable application that will have three interfaces working with the backend.. Web, desktop, and mobile.
This must be done completely in html and Javascript with ajax doing the dynamic bits.
A few questions.
For modular design, a page will end up having 10 to 20 ajax calls for each dynamic part. Is it best to do this many ajax calls, or.. Have a large ajax call that does it all and inject each part into the dom all at once (perhaps actually using xml)? Or should the php backend just generate the whole page needed at once and then inject the whole page? I'm a bit lost here.
I'm planning on doing a single page application where the content is injected into a main template when each "page" is loaded. These pages will have their own js and ajax calls. Can this be done.. Injecting js into the content and expecting it to run? Or, it is best to have a single minified js file containing every function for every page?
Anchor based navigation. I'm planning on using hash bang urls (it was specifically requested not to use html5 history api). Any tutorials for this so the page is loaded on regular navigation and cold loaded into the address bar?
Any tips welcome. This is my first foray into this kind of development. I'm excited. This is the future!
This must be done completely in html and Javascript with ajax doing the dynamic bits.
A few questions.
For modular design, a page will end up having 10 to 20 ajax calls for each dynamic part. Is it best to do this many ajax calls, or.. Have a large ajax call that does it all and inject each part into the dom all at once (perhaps actually using xml)? Or should the php backend just generate the whole page needed at once and then inject the whole page? I'm a bit lost here.
I'm planning on doing a single page application where the content is injected into a main template when each "page" is loaded. These pages will have their own js and ajax calls. Can this be done.. Injecting js into the content and expecting it to run? Or, it is best to have a single minified js file containing every function for every page?
Anchor based navigation. I'm planning on using hash bang urls (it was specifically requested not to use html5 history api). Any tutorials for this so the page is loaded on regular navigation and cold loaded into the address bar?
Any tips welcome. This is my first foray into this kind of development. I'm excited. This is the future!