Adding the Dojo framework
In this recipe, we will set up the Dojo framework for use within Moodle. We will then create a simple Dojo script which displays a JavaScript alert when the page has fully loaded, making use of Dojo's addOnLoad
feature.
A brief description of the framework from the Dojo website (http://dojotoolkit.org/):
Dojo saves you time, delivers powerful performance, and scales with your development process. It's the toolkit experienced developers turn to for building superior desktop and mobile web experiences.
A typical need for installing this framework would be a situation where you wish to make use of a third party code, which has been written on top of the Dojo framework and it is either not possible, or it is impractical, to re-implement it as either native JavaScript code, or based on top of Moodle's preferred JavaScript library, YUI.
Getting ready
First, we need to obtain a copy of the Dojo framework file. Visit the Dojo website at http://dojotoolkit.org/, and navigate...