PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Cloning Google Suggest With Ajaxac

Our Gameplan

First things first — we need to work out how to approach this whole thing.

We are going to create four files in this article:

  1. index.php — This is the frontend file that the user visits to use the application
  2. googlesuggestclone.css — This stores all of our stylesheet information
  3. googlesuggestclone.js — This is a JavaScript file that contains various utility functions that will be needed
  4. GoogleSuggestCloneJax.class.php — This is our AjaxAC application, which pieces everything together.

We will be creating all four files simultaneously – building parts of one, then moving to the next, then going back, etc, until we are done. Additionally, there will be an SQL data file we will use to create our index of search suggestions.

Also, if you don’t already have a copy of AjaxAC, you will need to download it from http://ajax.zervaas.com.au

You could implement this application without a framework such as AjaxAC, but using it allows a structured approach to building the necessary JavaScript, as well as keeping all backend data operations in the same place. Additionally, it allows you develop future AJAX applications using a similar structure.

Although AjaxAC is still in relatively early development, the future features it will offer also will aid greatly in developing these kinds of applications, such as a standard data exchange format, backend logging and debugging, as well as simplified JavaScript code generation.

So let’s get started, first stop is creating the index.php file.

In This Article