AJAX

Jump to: navigation, search

Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: AJAX.

AJAX (Asynchronous Javascript and XML) is a modern web design technique that allows for more interactivity by making webpages that fetch data in the background and alter themselves without reloading. This makes the website feel much more like an application. AJAX is a new way of working with existing technologies (including HTML, Javascript, CSS and the XMLHttpRequest object amongst others) rather than a new piece of technology in itself.

Ajax in Moodle

YUI framework

As of July 2006, Moodle has adopted the Yahoo! user interface library and most future work in this area will build upon that foundation.

There are several current projects that make use of these technologies e.g.:

AJAX renderers

As of Moodle 2.0, AJAX output can be generated by creating an ajax renderer class named something like mod_forum_renderer_ajax in the same way and in the same file as the normal renderer. If a script is marked as being an AJAX script by having this line placed at the top of the file (before any other code)

 define('AJAX_SCRIPT', true);

then the AJAX renderer will be used in place of the main one for all components if it exists.

See also