Help:Including additional CSS and JS

You can use the global JavaScript method  to include articles containing scripts or styles on your wiki that are not included by default. This method will work with local articles (such as "MediaWiki:Wikia.js") or external articles (such as "w:c:dev:Mediawiki:External_include.js" -- see Interwiki Links for more information). Using this method will combine all of the articles you need into one request and minify them. This will reduce file size and web traffic to help make your wiki faster.

Usage
To use this method, you will need to provide an options object containing the type of articles to include (either "script" or "style") and an array of article names.

For example, if you wanted to import two JavaScript articles, one from the local wiki and one from an external wiki, your code would look something like this:

Likewise, if you wanted to include two Stylesheet articles, one from the local wiki and one from an external wiki, your code would look something like this:

If you only need to include one file, you may use this alternate syntax:

Most users will probably want to include both "script" and "style" in the same JavaScript article. To do so, you must make separate declarations, like so:

Advanced Usage
is mainly a convenience function. Its job is to build a proper URL, perform sanity checks and provide you with error messages. But you do not truly need  to build the URL. You can do so yourself.

The URLs look like this:

The ResourceLoader is a complex beast and there are a few parameters you might want to add but these ones are essential:

You could use such an URL in an @import rule in a CSS file:

or with jQuery.getScript in a JS file:

Using importArticles in global script files
If you want to speed up your w:Special:Mypage/global.js or w:Special:Mypage/wikia.js or w:Special:Mypage/monobook.js with, you will face a little problem: A lot of the wikis you'll visit will have already been updated to MediaWiki 1.19.1. But some may not have been updated yet and  will be.

As a workaround you could add a pseudo-version of  that will be used if the real thing is unavailable:

de:Hilfe:Einbinden mehrerer JavaScript oder CSS Dateien es:Ayuda:Incluyendo JavaScript y CSS adicional fr:Aide:Inclure JavaScript et CSS supplémentaire it:Aiuto:Includere JavaScript e CSS addizionali nl:Help:Bijkomende JavaScript en CSS laden