Forum Moderators: open
The server is able to handle scripts (asp/php).
I don't want to reload the complete page, since that would be a waste of bandwith and response time I guess.
After my Frames time, I started using Iframes, which made it a little better. Now I have been reading about AJAX which is able to load content within a div dynamically.
Would it be a good idea to load the content of the page (which is normally a new page) in to a div? So it would load: text and images (but no buttonbar, layout and styles since they are already included in that page)?
Is this a good idea and if not, what will be wrong with it?
AJAX definitely seems to be a coming technology, but some older browsers will not be able to handle the XMLHttpRequest() method.
An older technique that can give you a similar result is iframe RPC. You can load data into a hidden iframe and then use JS to access the iframe contents. If search google for 'iframe rpc', you should see some good resources.
On the other hand, if you are not concerned with older browsers, AJAX might just fit the bill.
ajkimoto
I don't want to reload the complete page, since that would be a waste of bandwith and response time I guess.
That is not the case. All the layout elements of the page, the images, any style sheets or javascripts or whatever, will already be in the users cache. So the bandwidth saving and decreased reponse time are marginal at best and not really worth considering.
There are sometimes good reasons for loading pages individually, but that isn't one of them.
What you'll need to do is make sure that there are still real, hard-coded links to the different "pages" of your site in your source code.
Plus, for your users, you want to make sure that when they are looking at a particular "page" of your AJAX swapping content that they can copy and paste the URL from the address bar to bookmark or send to a friend. This problem is being dealt with in creative ways by the AJAX pioneers out there. (Try some searches for "ajax bookmark," "ajax back button," or similar topics.)