Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Voices That Matter

How To Use AJAX

  • Print
  • + Share This
Like this article? We recommend

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>
  • + Share This
  • 🔖 Save To Your Account