Javascript FAQ: Difference between revisions
Damyon Wiese (talk | contribs) (→Books:) |
(This is not the place to learn what JS is.) |
||
(9 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{obsolete}} | |||
== What is JavaScript? == | == What is JavaScript? == | ||
JavaScript is a scripting language widely used for client-side web development. It is also known | 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? == | == Where do I find general information about JavaScript? == | ||
Line 9: | Line 11: | ||
=== Online resources: === | === Online resources: === | ||
* [http://en.wikipedia.org/wiki/JavaScript JavaScript (Wikipedia)] | * [http://en.wikipedia.org/wiki/JavaScript JavaScript (Wikipedia)] | ||
* [ | * [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide Mozilla JavaScript guide] | ||
=== Books: === | === Books: === | ||
Line 18: | Line 20: | ||
== How is JavaScript used by Moodle? == | == How is JavaScript used by Moodle? == | ||
* See [ | * See [[Javascript]]. | ||
== Where do I find more information about JavaScript in Moodle? == | == Where do I find more information about JavaScript in Moodle? == | ||
Line 27: | Line 29: | ||
== What JavaScript library does Moodle use? == | == What JavaScript library does Moodle use? == | ||
=== JQuery === | === JQuery === | ||
As of Moodle | {{Deprecated|version=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) === | === Yahoo! User Interface Library (YUI) === | ||
{{Deprecated|version=2.9}} | |||
As of Moodle 2.9, the user of YUI is generally discouraged. | |||
==== Online resources: ==== | ==== Online resources: ==== | ||
* [http://yuilibrary.com Yahoo! User Interface Library (YUI)] | * [http://yuilibrary.com Yahoo! User Interface Library (YUI)] | ||
* [[YUI]] in the Moodle documentation | * [[YUI]] in the Moodle documentation | ||
* [https://alloyui.com/rosetta-stone/ Migrating YUI code to jQuery] | |||
==== Books: ==== | ==== Books: ==== | ||
* [http://shop.oreilly.com/product/0636920013303.do YUI 3 Cookbook] by Evan Goer | * [http://shop.oreilly.com/product/0636920013303.do YUI 3 Cookbook] by Evan Goer | ||
* [http://shop.oreilly.com/product/0636920025245.do Maintainable JavaScript] by Nicholas C. Zakas | * [http://shop.oreilly.com/product/0636920025245.do Maintainable JavaScript] by Nicholas C. Zakas | ||
==== Why are we moving away from YUI ? ==== | ==== Why are we moving away from YUI ? ==== | ||
The decision to begin the transition from YUI to JQuery was made here: | The decision to begin the transition from YUI to JQuery was made here: | ||
Line 58: | Line 52: | ||
This is in response to Yahoos announcement that they will be ceasing all further development on YUI (although it is still maintained). | This is in response to Yahoos announcement that they will be ceasing all further development on YUI (although it is still maintained). | ||
http://yahooeng.tumblr.com/post/96098168666/important-announcement-regarding-yui | http://yahooeng.tumblr.com/post/96098168666/important-announcement-regarding-yui | ||
== See also == | == See also == | ||
* [[jQuery]] | * [[jQuery]] | ||
[[Category:FAQ]] | [[Category:FAQ]] | ||
[[Category:Javascript]] | [[Category:Javascript]] | ||
[[Category:AJAX]] | [[Category:AJAX]] |
Latest revision as of 15:21, 5 December 2022
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:
Books:
- JavaScript: The Good Parts by Douglas Crockford
- JavaScript: The Definitive Guide, Fifth Edition by David Flanagan - Really the ultimate reference guide (nearly 1000 pages).
- The JavaScript Anthology: 101 Essential Tips, Tricks & Hacks by James Edwards & Cameron Adams - Promotes accessible JavaScript solutions by following the principles of progressive enhancement and unobtrusive scripting.
How is JavaScript used by Moodle?
- See Javascript.
Where do I find more information about JavaScript in Moodle?
- JavaScript Guidelines by Tim Hunt (work in progress)
- Use of JavaScript in Moodle discussion in the General developer forum
What JavaScript library does Moodle use?
JQuery
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:
- Yahoo! User Interface Library (YUI)
- YUI in the Moodle documentation
- Migrating YUI code to jQuery
Books:
- YUI 3 Cookbook by Evan Goer
- Maintainable JavaScript by Nicholas C. Zakas
Why are we moving away from YUI ?
The decision to begin the transition from YUI to JQuery was made here:
https://tracker.moodle.org/browse/MDL-47036
This is in response to Yahoos announcement that they will be ceasing all further development on YUI (although it is still maintained). http://yahooeng.tumblr.com/post/96098168666/important-announcement-regarding-yui