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:

de:Hilfe:Skins/importArticles nl:Help:Bijkomende JavaScript en CSS laden