Web Frameworks - Workbook - Week 08

From mi-linux
Revision as of 16:46, 2 February 2010 by In9352 (talk | contribs)
Jump to navigationJump to search

Main Page >> Web Frameworks >> Workbook >> Workshop - week 08

Ajax: Increased responsiveness and interactivity of web pages is achieved by exchanging small amounts of data with the server "behind the scenes" so that the entire web page does not have to be reloaded each time there is a need to fetch data from the server. (Wikipedia.org)

As explained in class, it works like this:

  1. The user interacts with the page and triggers an event.
  2. JavaScript code sends a request to the server, and handles the response.
  3. Some server-side code handles the request (get data from database and return to client)

Zend 07.gif

Let's get started!

Step 2

Yes, we'll start with step 2. We don't really want to type a load of JavaScript, since there are plenty of existing libraries available on the net (and this module is all about reusing code, right?).

You may have heard of jquery or the Prototype library. For this example we'll use the latter.


"Prototype is a JavaScript Framework that aims to ease development of dynamic web applications. Featuring a unique, easy-to-use toolkit for class-driven development and the nicest Ajax library around, Prototype is quickly becoming the codebase of choice for web application developers everywhere." (source)

Download the file from here, and save it to public/scripts as prototype.js.