Ajax Tutorial

This application is formatted to be used in landscape mode. If used in portrait mode, the code samples wrap and can be difficult to read.

This tutorial explains and gives examples on how to make a web page dynamic by using Ajax technology. It is not intended to be an Ajax reference, but rather contains practical code samples showing how to make web pages dynamic and pleasant to use. The examples shown here can be used as building blocks for your own web pages.

PHP is the language used in the server script examples. In the PHP code samples, there is also an example of connecting to and querying a MySQL database using PHP functions.

In addition to showing how to use the Ajax technology I also show examples of dynamically updating a dropdown selection list, dynamically updating a HTML table, and dynamically updating text and headers. All without performing a page reload.

This tutorial also contains a brief MySQL reference section showing examples of performing table creation, select, insert, update and delete commands. For a more extensive MySQL reference you can download my MySQL Ref application from the iTunes app store.

Ajax technology is not difficult to learn and the benefits of using it are great. Basic understanding of HTML, Javascript and a server side scripting language such as PHP will increase the learning curve. You will find a large part of the work is done in javascript. Working knowledge of javascript will help in the learning process, but is not absolutely necessary. You will be able to find many good javascript tutorial sites on the web, most of them with code samples to follow.

The application is seperated into the following categories:

  • About Ajax Tutorial
  • What is Ajax
  • XMLHttpRequest Object Details
  • Call Javascript Function
  • Create XMLHttpRequest Obj
  • Basic PHP Server Script
  • Parse Server Response Basic
  • Parse Server Response Advanced
  • Dynamic Dropdown List
  • Dynamic Table
  • Dynamic Text
  • MySQL Reference

  • The MySQL Reference section contains the following list of detail sheets

    Table Cmds
  • Create
  • Copy
  • Drop
  • Select
  • Basic
  • Distinct
  • Where
  • Insert
  • Single Row
  • Multiple Rows
  • Update
  • All Records
  • Update Where
  • Delete
  • Delete All Records
  • Delete with Where