Web Design Forum  
 
Go Back   Web Design Forum > Web and Graphic Design > Web Design

Reply
 
LinkBack Thread Tools Display Modes
Old 08-16-2008, 10:55 PM   #1 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 23
Default How to make a page load dynamically?

Hello all,

What would be the best way to load content dynamically, where the header and possibly the menu do not have to refresh? Similar to this website. Are there any how-to's on this subject? I've realized I have a lot to learn in web design...
werm82 is offline   Reply With Quote
Old 08-18-2008, 01:07 AM   #2 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 8
Default

Learn AJAX. You can send information to the server without having to reload a page.

Better yet, if you don't want to go into the details, use the jQuery application. Just include this in your head:
Code:
<script type="text/javascript" src="jQueryFile.js"></script>
And use the jQuery AJAX code:

Code:
 $.ajax({
   url: "newpage.htm",
   success: function(html) {
     $("#someobject").html = html;
   }
 });
This will load "newpage.htm" into the "someobject" object.

http://www.jquery.com/
__________________
www.mikeburt.net
mburt is offline   Reply With Quote
Old 08-18-2008, 01:21 AM   #3 (permalink)
Moderator
 
jnjc's Avatar
 
Join Date: Jun 2008
Posts: 365
Default

I wouldn't worry about this. On each page have you header etc. your browser will cache images and .css etc. so it won't look like you header is loading each time (I pretty sure this is how this page is structured).

If you start using ajax calls you become less search engine friendly and things like the back button and history won't work properly either.

HTH,
JC
jnjc is offline   Reply With Quote
Old 08-18-2008, 02:08 AM   #4 (permalink)
joe
Bronze Member
 
Join Date: Aug 2008
Location: Dallas, Tx
Posts: 83
Default

it's best to reload the menu's and navigation each time. The browser will cache them (as jnjc states above) so there's no worry about lag time there. If you are intent on dynamic page loading, you can use a javascript function to call xmlhttprequest to go get the information from a php (or whatever your scriping language of choice is) page to send the information back to your function.
joe is offline   Reply With Quote
Old 08-19-2008, 04:25 AM   #5 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 23
Default

Fantastic! Thanks for the advice. The reason I'm looking to do this is purely aesthetics. Does the script mess up the search crawling a tremendous amount?
werm82 is offline   Reply With Quote
Old 08-19-2008, 05:08 AM   #6 (permalink)
Moderator
 
jnjc's Avatar
 
Join Date: Jun 2008
Posts: 365
Default

Quote:
Originally Posted by werm82 View Post
Fantastic! Thanks for the advice. The reason I'm looking to do this is purely aesthetics. Does the script mess up the search crawling a tremendous amount?
If your concern is loading of the header content, you will have no real aesthetic value using ajax calls. And it will definitely have a negative effect on web crawlers. Also your users won't be able to bookmark particular pages or use the back buttons etc. without you putting in a lot of effort.

In my mind it makes no sense to use Ajax for what you are trying to achieve...
jnjc is offline   Reply With Quote
Old 08-19-2008, 05:50 PM   #7 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 23
Default

Well, I can scratch that off my "to-do" list! Thanks for the advice. I'll keep the AJAX in my back pocket for when I find a more appropriate application.
werm82 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 03:29 AM.


Computer Forum - TechZine - Webpage Design

 
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.