Changing Page Content without Reloading the Full Page

Written: July 6, 2010

My client Santa Cruz Veterinary Hospital wanted to show several pages worth of information and I decided to use links on the right hand side that would dynamically load content into the center column:

Normally when you click a web page link then your browser blinks and you wait while new content is loaded. Using Ajax I was able to have only the center part of the page update when a link is clicked. Here’s the HTML for the link code:

I’m calling a javascript function named “ajaxpage” and passing it two fields:

This javascript is defined in my file ajax-page.js which you can read and re-use. I got it initally from www.dynamicdrive.com , a great resource.

In the center of my page I have a DIV statement where new content gets loaded into:

You may have noticed that this page uses Tables and are asking yourselves, “Why is Daniel still using tables in the era of CSS?”
Simple answer, I took over this site from another web developer and didn’t want to re-factor it and remove all tabels. Tables work, CSS works, use them both as needed.

Tags: ,

Leave a Reply