O'Reilly logo

jQuery for Designers Beginner's Guide by Natalie MacLees

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action — adding Ajax magic

If you click around this small and simple site in your browser, you'll see that we're reloading the same header, navigation, sidebar, and footer over and over again. Only the content in the main content area of the page is changing from page to page. Let's use the magic of jQuery to fix that.

  1. Just a reminder that these Ajax functions won't work unless your pages are being served by a server. To see this code in action, you'll either have to upload your pages to a server or create a server on your own computer. First, we'll open our scripts.js file and set to work writing our code. We'll get started as we often do with the document ready statement as follows:
    $(document).ready(function(){ // Our code will go here ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required