I’ve finally managed to get the hang of CSS (I think anyway!) and I was wondering if this is possible:
I have a number of different div’s on my page, including a navigation div and a content div. Am I able to include a link in the navigation div to a html file (that contains different content) and have that load into the content div when it’s clicked? So, it would basically work similar to a frames page, where your links are in one frame and the content all displays in another but doesn’t have to reload the whole index page over and over.
And just so you know, I’m not that advanced in any form of scripting languages, aside from a little tweaking, trail and error in Javascript…
What do I insert in place of the ## (they’re there for appearances sake just because I don’t know what to use) Obviously if I put home.html or about.html they will just open up as a normal separate page and won’t be inside the content div like I want them to be.
An IFRAME would be more suited for this type of endeavor.
Skip the <div>, just use <iframe src=“bar.html” width=“x” height=“y”>Sorry, your browser doesn’t support inline frames. <a href=“bar.html”>See the page that should be here.</a></iframe>.
You can run a search on google and find out how to use iframes (because I’m going on memory here) but basically if the browser supports it (IE4+, NS6+, Mozilla, Opera, etc.) then it will display the document in a frame. If not, it displays what’s between the <iframe> and </iframe> tags.
PHP code is only actioned on the server, therefore you would have to refresh the page after selecting a link for the new content to be displayed.
How much information will you be displaying on each page? It’s not a practical solution for a large site as there’s a real overhead on initial loading, but if it’s a relatively small site with limited graphics, I like to use hidden divs. Example.
Assuming you have SSI supported, you can then use includes from external files to populate your page on loading. I note that you say that you don’t think that you have SSI, but it’s definitely worth checking with a simple SHTML page.