Home / Articles / How To Use AJAX

How To Use AJAX

Article Description

AJAX, an acronym for Asynchronous JavaScript and XML, is very hot in the growing universe of Web development. While this new technology offers some great capabilities, it also sparks some unquestionable debate over issues with the Back button. Kris Hadlock explains how to use AJAX in a real-world situation and how you can assess its value in a project. By the time you finish reading this article, you'll know what AJAX is as well as where, why, and how to use it.

Like this article? We recommend

Adobe Photoshop CS2 Official JavaScript Reference

Adobe Photoshop CS2 Official JavaScript Reference


Where To Start

First, you'll need to create the XML file that we will later request and parse as page content. The file that you're requesting must reside on the same server as the finished project.

Next, create the HTML file that will make the request. The request will happen when the page loads by using the onload method in the body tag. The file will then need a div tag with an ID so that we can target it when we're ready to display the content. When you've done all this, the body of your page should look like this:

<body onload="makeRequest('xml/content.xml');">
  <div id="copy"></div>
4. Creating the Request Object | Next Section Previous Section