Hello, Now that I have time, I'm making plans for a complete revamp of my website. One of the main aims is to totally re-organise the code base and structure. To do this, I plan to use CSS for all formatting and element placement on the pages. This is done to avoid frame use completely, which is old fashioned (from what I've read) and also poses major headaches for accessibility - being partially sighted myself I'd be a hypocrit if I ignored that. Picture a standard five sectioned page, header, footer, a left and right column, and a central area for the content. My issue is, that I want to maximize efficiency from the word go, which means reducing the number of page reloads. So, each time someone clicks on a link in the top navbar (header) or left colum, I want only the content in the middle section to refresh, not the entire page. I've been focussed on desktop application development for the last two years so I'm a bit rusty on the web side of things. But I was thinking of a simple PHP script within the page that would, if a user clicked on a given link on the page, load the corresponding content from another file into the central section. My problem is, how to do this without refreshing the whole page, or as I'm not using frames, can this not be done? If it can't be done, am I then left with the standard html include statements and reloading all parts of the page, but simply using includes to avoid code replication? Thanks for your tips. H.
You'd want AJAX, but you should be OK with an entire new page call. Most of it will be cached anyway. So, yes, to your last question.
First off if you want to do this then you'll have to mess around with AJAX which can be touchy if you don't know what your doing with it. Most of the time webpages are small and don't need to use AJAX, a much better way to do things is to only do AJAX when the user is at a multi-part form, or on a page that is really load intensive. But it all depends on the actual implimentation that your doing, but if your pages load fast then don't bother with AJAX you'll just cause yourself headaches.
Thanks, sorry for the delay in getting back here. I'll stick with a basic implementation for now, you are right the new site is not that complex yet. I've looked at Ajax, it looks just the thing I could use in the future, but a little complicated at the moment. H.