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.

Be aware that this will not work for any interwiki link that has a dot in the name, like inter-language links. For example, if you wanted to import w:c:it.onepiece:MediaWiki:Common.js/togglers.js, it will fail. See Interlanguage Links to workaround this.

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:

Interlanguage Links
does not fully implement the interwiki link behaviours. It can't handle any links that have dots in the name, you can usually (but not always) work around this problem by just leaving the dot out: Be aware that this problem also affects Answers wikis and any other Wiki that has multiple subdomains: w:c:onepiece.answers will not work either, you need to use ' '.

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, this allows you to fast-load CSS using the native CSS  directive so that your Wiki won't look ugly or broken to people who have JavaScript disabled.

The URLs look like this:

The ResourceLoader is a complex beast but in this particular case only these parameters 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 MediaWiki 1.16.5
If you would like to use the cleaner  syntax in a MediaWiki 1.16.5 Wiki then you can place the following code at the top of your   page. Note that this code will not give you the speed improvements that the real  does, it just lets you use the newer syntax until your Wiki is upgraded. This helps you prepare your wiki for the upgrade in advance so that the benefits of  will kick in immediately after the upgrade happens.

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