View Full Version : load a page in a div
java2
01-10-2006, 01:47 PM
Ok question goes..
i have links to my pages in a navigation div. Is there a way to get it just to load into a different div, don't know if i can target it or something.. Basically i want to click on a link from the nav div and it load in the page div without the nav div reloading.
i think that makes sense, anyway please help if you can
_Aerospace_Eng_
01-10-2006, 01:50 PM
Search around for opening links in iframe on the forums.
http://www.codingforums.com/showthread.php?t=76025
Read that ^^
degsy
01-10-2006, 01:55 PM
Your best bet would be to use serverside includes with PHP or ASP.
Another way would be to have all the content loaded into divs and then show/hide them on click. Could create a rather large page though.
mark87
01-10-2006, 02:03 PM
Could use Ajax (http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm). :D
rmedek
01-10-2006, 02:23 PM
Ugh. Using Ajax (or any of these "solutions," minus the server-side includes) breaks the back button. Maybe fine for some things, but for the main navigation? That's just not cool.
java2
01-10-2006, 02:28 PM
Thanks. i'd rather not use frames if possible because i have used them before and we didn't get on with each other. I have heard that i need to use PHP but as i have never used it before i am out of my depth.
could someone post a link to a good tutorial for this?
thanks
ronaldb66
01-10-2006, 02:50 PM
PHP--or another server side approach--may save you from the trouble having to include your on each and every page, but it won't prevent the page from having to reload.
Which makes me wonder: why is it so terrible to load a page in its entirety on each page request?
java2
01-10-2006, 02:53 PM
if you have images then it'll have to keep on reloading those images each time. thus slowing the navigation down
ronaldb66
01-10-2006, 03:01 PM
If you reuse (part of) those images in each version of the menu, they likely will be pulled from the cache, strongly reducing download efforts; this effect can be enhanced further if images are used as backgrounds for text links instead of for texts-as-images.
java2
01-10-2006, 03:07 PM
Well im not sure wot that post meant but as a newbie is just makes logical sense for me to load text within my graphical menu rather than loading my graphical menu into my different pages.
mark87
01-10-2006, 03:22 PM
Ugh. Using Ajax (or any of these "solutions," minus the server-side includes) breaks the back button. Maybe fine for some things, but for the main navigation? That's just not cool.
Was just giving him another alternative. :)
java2
01-10-2006, 03:49 PM
Well i got the iframes working. Is this gonna work most of the timeor am i better off learnign php
rmedek
01-10-2006, 04:07 PM
The iframes will keep the navigation area from reloading, but it will also break the user's back button. In other words, they click "bio," they click "news," want to go back to "bio", they click the back button… they are on whatever website they were on before yours.
PHP includes are a way to keep the navigation area in one file, so you don't have to add it on every page. It won't keep the navigation from reloading, though.
The point Ronald was trying to make is that your browser is going to cache what it already downloaded, so even though it's reloading a new page, it's really only dealing with new content, not the navigation it already has cached.
java2
01-10-2006, 04:15 PM
Thanks
it sounds like php will be useful for the future so i will start learning.
cheers for help
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.