If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Javascript FAQ

From MoodleDocs
Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable.

What is JavaScript?

JavaScript is a scripting language widely used for client-side web development. It is also known as ECMAScript and has been progressively improved over the years.

Since Moodle 3.8 we recommend the use of Native JavaScript rather than through a library such as jQuery or YUI, and require that all new JavaScript be written in the style of ES 2015 modules. These should be placed in the amd/src directory of a component and are transpiled at development time to be compatable with a wide range of browsers.

Where do I find general information about JavaScript?

Online resources:


How is JavaScript used by Moodle?

Where do I find more information about JavaScript in Moodle?

What JavaScript library does Moodle use?


This feature has been marked as deprecated since Moodle 3.8

As of Moodle 3.8, the user of jQuery is generally discouraged and the use of Native or Vanilla Javascript is recommended.

Yahoo! User Interface Library (YUI)

This feature has been marked as deprecated since Moodle 2.9

As of Moodle 2.9, the user of YUI is generally discouraged.

Online resources:


Why are we moving away from YUI ?

The decision to begin the transition from YUI to JQuery was made here:

This is in response to Yahoos announcement that they will be ceasing all further development on YUI (although it is still maintained).

See also