Book Image

Learning Drupal 6 Module Development

Book Image

Learning Drupal 6 Module Development

Overview of this book

Table of Contents (14 chapters)
Learning Drupal 6 Module Development
About the Author
About the Reviewers

Writing a Drupal AJAX/JSON Service

AJAX stands for Asynchronous JavaScript and XML. AJAX refers to the practice of using JavaScript on the client side to retrieve XML from the server without requiring a page reload. This is typically done with the XMLHttpRequest (XHR) family of JavaScript objects.

However, the term is often used to capture a broader range of functionality than just XML over HTTP. For example the term AJAX is also used to describe retrieving fragments of HTML or JavaScript using XHR objects.

The JSON Format

One common alternative to using XML as the format for data exchange is to use the JSON format. JSON (JavaScript Over the Network) is a compact, easy-to-parse format that uses a syntax identical to JavaScript's array and object literal syntax.


The JSON specification, along with numerous links to implementations and tutorials, can be found at

For example, an XML document describing three British Empiricist philosophers might look as follows: