Digitry Designs Posted April 27, 2010 Share Posted April 27, 2010 Hello and thank you for reading. Simply put, I am building my site and I currently have one page that "include_once();" several pages that hold the divs. ie <html> <head> <title></title> here are all my <link rel css/text href=template/css/main.css> <link rel css/text href=template/css/flash.css> and so on </head> <body> <?php include_once('header.php'); include_once('menu.php'); include_once('content.php'); include_once('login.php'); include_once('sidebar.php'); include_once('footer.php'); </body> <html> sorry for the crudness in code but i think you get my point. Now I want to click on a link from the menu and say only the content.php and sidebar.php would change without forcing the user to reload the page on every click of a link. Any ideas? Thank you in advance. Quote Link to comment https://forums.phpfreaks.com/topic/199981-need-to-load-alternate-content-to-currently-displayed-site/ Share on other sites More sharing options...
cags Posted April 28, 2010 Share Posted April 28, 2010 The only way this could be done is by using AJAX to fetch the contents of those divs and replace them. Quote Link to comment https://forums.phpfreaks.com/topic/199981-need-to-load-alternate-content-to-currently-displayed-site/#findComment-1049777 Share on other sites More sharing options...
Digitry Designs Posted April 28, 2010 Author Share Posted April 28, 2010 The only way this could be done is by using AJAX to fetch the contents of those divs and replace them. Thank you for your help! Would you know a good direction to point me in? I know I can Google it, but that is what I usually do and after spending hours looking and trying, sometimes it is hard to find something that really works or is not an ad page for a book. I appreciate your help. Quote Link to comment https://forums.phpfreaks.com/topic/199981-need-to-load-alternate-content-to-currently-displayed-site/#findComment-1049845 Share on other sites More sharing options...
cags Posted April 28, 2010 Share Posted April 28, 2010 I'm not especially familiar with AJAX so couldn't really say, but to be honest with you, it's best avoided, you would be better off reloading the whole page. Loading only small sections with AJAX will break browser forward/back history buttons working. Quote Link to comment https://forums.phpfreaks.com/topic/199981-need-to-load-alternate-content-to-currently-displayed-site/#findComment-1049848 Share on other sites More sharing options...
Digitry Designs Posted April 28, 2010 Author Share Posted April 28, 2010 I'm not especially familiar with AJAX so couldn't really say, but to be honest with you, it's best avoided, you would be better off reloading the whole page. Loading only small sections with AJAX will break browser forward/back history buttons working. Thank you for the input! is there a way to cache the images (i know there is a way to cache the images) or do you know how i would be able to cache the images for faster load time? Any input here would be very helpful. The site I am building is kind of graphic intense. Any ideas? Thank you again. Quote Link to comment https://forums.phpfreaks.com/topic/199981-need-to-load-alternate-content-to-currently-displayed-site/#findComment-1049857 Share on other sites More sharing options...
cags Posted April 28, 2010 Share Posted April 28, 2010 The images aren't actually part of the page source, they are simply linked to from the source. Images are likely cached by default. If you want proper control of this you will have to delve into Apache directives to change the cache settings for images. Quote Link to comment https://forums.phpfreaks.com/topic/199981-need-to-load-alternate-content-to-currently-displayed-site/#findComment-1049858 Share on other sites More sharing options...
Digitry Designs Posted April 28, 2010 Author Share Posted April 28, 2010 lol not exactly what i wanted to hear but thank you any how. I do appreciate your help. Quote Link to comment https://forums.phpfreaks.com/topic/199981-need-to-load-alternate-content-to-currently-displayed-site/#findComment-1049861 Share on other sites More sharing options...
teamatomic Posted April 28, 2010 Share Posted April 28, 2010 google: javascript preload images as for a good ajax framework I'd suggest prototype. One reason is that if you want to get pretty, scriptaculous lays right over the top of it. For simple boxes and images I'd suggest iBox. HTH Teamatomic Quote Link to comment https://forums.phpfreaks.com/topic/199981-need-to-load-alternate-content-to-currently-displayed-site/#findComment-1049948 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.