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

AJAX: Difference between revisions

From MoodleDocs
No edit summary
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''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 (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 ==
== Ajax in Moodle ==


Moodle has recently (July 2006) adopted the [[Development:YUI|Yahoo! user interface library]] and most future work in this area will  build upon that foundation.
=== YUI framework ===
 
As of July 2006, Moodle has adopted the [[Development:YUI|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.:
There are several current projects that make use of these technologies e.g.:
Line 9: Line 11:
* [[Chameleon]] theme
* [[Chameleon]] theme
* [[Student projects/AJAX course format]]
* [[Student projects/AJAX course format]]
=== 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 ==
== See also ==


* [[Javascript FAQ]]
* [[Javascript]]
* [[Javascript]]
* [[Unobtrusive javascript]]
* [[Unobtrusive javascript]]
* [[Hijax]]
* [[Hijax]]
* [[Development:Firebug#Debugging_AJAX_with_Firebug|Debugging AJAX with Firebug]]


* [http://www.adaptivepath.com/publications/essays/archives/000385.php ''Ajax: A New Approach to Web Applications'', the original Ajax article by Adaptive Path]
* [http://www.adaptivepath.com/publications/essays/archives/000385.php ''Ajax: A New Approach to Web Applications'', the original Ajax article by Adaptive Path]

Latest revision as of 09:18, 16 May 2011

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