UseJS
Appearance
(Redirected from User:Pathoschild/Scripts/Usejs)
UseJS
-
Screenshot of the transclusion notice box.
UseJS imports JavaScript for the current page when the URL contains a parameter like &usejs=MediaWiki:Tabs.js
. It only accepts scripts in the protected MediaWiki:
namespace, so these are equivalent: &usejs=MediaWiki:Tabs.js
, &usejs=tabs.js
, &usejs=tabs
.
Installation
[edit]- Copy the following code to your global.js page (for all wikis) or your common.js page (for Meta only).
/** * Imports JaveScript for the current page when the URL contains a &usejs parameter. * @see https://meta.wikimedia.org/wiki/UseJS * @update-token [[File:Pathoschild/usejs.js]] */ mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.usejs.js');
- Refresh your browser to reload the JavaScript. (In Chrome or Firefox, press [CTRL] and [R] at the same time.)