Many organizations now offer web-based applications that rival local applications in their functionality and user interface. Ajax plays a key role in most of these applications. Ajax is not a specific technology as much as a collection of techniques that allows a web developer to dynamically update the currently displayed page with data retrieved from the server. This example-driven course will give you the tools you need to implement your first Ajax application.
The course then shows multiple, increasingly complex examples of Ajax in action. You will see how to pass parameters to a server and receive data in the form of character strings, HTML fragments, or XML. You will also see how to incorporate data into a web page dynamically, adding elements like tables and pull-down lists that are built from data retrieved from the server. Several special situations are covered, including encoding parameters, passing data as XML, and using XML DOM methods to build HTML elements dynamically.
The course ends with a comprehensive example that uses what you have learned to implement "auto completion" for an input field.
Approximate Study Time: 2 hours
After completing this course, you should be able to:
- Describe the key technologies and techniques that comprise Ajax programming
- Identify potential Ajax applications
- Identify the benefits of receiving server data in XML format
- Order the steps involved in making an Ajax request
- Identify the methods and properties available with an XMLHttpRequest object
- Replace the contents of a displayed HTML object
- Receive an XML object in an HTTP request
- Parse an XML object to create HTML
- Identify the XML methods and properties used to create a new HTML object
- Describe how frameworks can dramatically reduce the effort required to code an Ajax program
- Describe the potential role of XSLT in transforming the server response into HTML
- Identify the changes that must be made to an Ajax program to use POST rather than GET to retrieve data
- Describe why parameters may need to be encoded before transmission
- Pass parameters to a server program as XML
- Describe how to force a browser to make a new server request rather than to use an obsolete page from its cache
Making Server Requests
Retrieving HTML Data
Retrieving XML Data
Handling Input Parameters
An Auto Completion Example
This course should be taken by individuals responsible for implementing an organization's web site. The audience includes webmasters, content developers, application programmers, and system administrators.
- eBusiness: From HTML to WebSphere
- Coding HTML and XHTML: Basic Elements
- Coding HTML and XHTML: Advanced Elements
The course also assumes you know how a CGI program or servlet creates HTML or XML output that is returned to a browser. This prerequisite can be satisfied by completing either of the previous courses of this series:
You may also have obtained these skills by taking other courses (such as the Java Fundamentals series) or through relevant work experience.