JavaScript

MediaWiki and JavaScript

JavaScript

Delivery

ResourceLoader : delivery system for optimized loading and managing of modules
Core modules, including jQuery and OOjs
API client code

Adding JS on-wiki

Interface (user-specific, group-specific and site-wide)
ContentHandler facility for supporting js as page content
Snippets
Extensions that allow you to add js
Extension:Gadgets, Extension:Widgets

Extensions, skins and other modules

ResourceLoader modules
Developing with ResourceLoader
$wgResourceModules , BeforePageDisplay hook
OOUI
Ajax and Ajax extensions

Further guidance

Category for all things JavaScript
Learning JavaScript
CORS
Broken scripts
Core development: coding conventions and unit testing
Technical docs on doc.wikimedia.org

This box: view · talk · edit

As of MediaWiki 1.17 most JavaScript code in MediaWiki is object-oriented and packaged as ResourceLoader modules that other code can depend on. Also jQuery was introduced in MediaWiki core in MediaWiki 1.16, and loaded by default on every page as of 1.17.

Before MediaWiki 1.16, most JavaScript was in wikibits.js and other files in /skins/common/.

See alsoEdit