Ajax Overview

  • Asynchronous JavaScript and XML
  • Combines client-side processing and server-side technologies
  • Client-side processing uses javascript
  • Server side uses a programming framework such as PHP, Ruby on Rails or ASP.net (unless request is a simple load action)
  • Produces more responsive user interactions

Ajax Process

Ajax Process Cycle

Same Origin Policy

Most browsers have a same origin policy, which prevents a page from making an Ajax request unless it is to the same server that the page came from. This policy prevents a page from making unauthorized requests.

Because of the policy, you will need use of a server to create pages that use Ajax. In addition to the student web server, you can install QuickPHP on your windows computer. Macs come with their own server and PHP, but the server will need to be activated for you to use it.

Use of JSONP is one work-around to the same origin policy.