My web application utilizes page reloads in places where the page structure changes.
For content changes initiated by the user it is all handled by Ajax.
However I’m planning on removing all the page reloads and replacing them with ajax calls that simply update the page using innerHTML for the body and head tags.
To do this I know have to manually call functions that are normally called by the onload event.
When I am done I will have a complete ajax application. My question is, is this standard practice now….I see a lot of applications where you do something and the whole page reloads, where even common elements are reloaded.
For example go to Apple.com and hit on the first button you see “Store”…you will see the whole page reload even the menu bar that does not change is reloaded wasting bandwidth..
Because I don’t see other people using complete ajax solutions…I wonder if I am headed down a wrong path.
My question?
Is a complete ajax based web application best practice? (of course file uploads aren’t supported, omitting this, is it best practice).
If so why do big sites not do it? I see few sites that actually employ ajax instead of page reloads.
There are a number of reasons not to go fully ajax. A few are:
if they pressed the back button, they’d go back to the previous site
they visited.
Lastly, it can be hell to debug a problem — I went full ajax on a project a while ago and ended up regretting it.
If none of the above are important to your project, and you’re looking to do something different, then by all means — the real question you need to ask is “does the added complexity justify the savings in bandwidth?”.