Creating a contacts application with part 1
In this tutorial, we’ll look at a new approach to building Web applications called AJAX. What’s so great about AJAX? Basically, you can create applications that don’t require users to continually reload Web pages. The AJAX approach isn’t suitable for every application but it can really enhance the user experience in simple applications.
The tutorial is split into two parts. In part 1, we’ll cover some of the theory behind AJAX and look at its advantages compared with server-side applications. You’ll see how we can work with XML content in the Web browser using JavaScript. We’ll cover:
- Understanding AJAX?
- Using the XMLHttpRequest object
In part 2, we’ll create a very simple AJAX address book application that takes its content from a series of XML documents. The application will display a list of contacts from an XML document. When the user clicks a contact name, we’ll load the details from another XML document and display them WITHOUT refreshing the page in the browser.
The application will use several different technologies. First, we’ll use JavaScript with the XMLHttpRequest object to load the content into our application. We’ll style the content with CSS and we’ll generate XHTML from the XML documents using XSLT (Extensible Stylesheet Language Transformations) stylesheets. If you’re not familiar with XSLT, it transforms a source XML document into a results document. In our case, we’ll use it to create XHTML from an XML document.
If you have a good understanding of the technologies involved in AJAX, you may want to skip part 1 and move straight to part two. However, stick around if you want a refresher or are new to the area. We’ll start with some of the theory behind AJAX.
Sas Jacobs
Hello. I'm the Principal of Anything Is Possible, an Australian web development business specialising in web applications development and training. I'm interested in using Flash with dynamic content and I've presented at a number of International conferences on topics relating to applications development, XML and scripting components. I have recently released my second print book Beginning XML with DOM and Ajax to match the first one - Foundation XML for Flash. I have a business web site
and a personal web site.