User:Str4nd/monobook.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/* Funktio sivujen lisäämiseen JavaScriptinä *
 * Tehnyt Nikerabbit                         */
function includeJsPage (page, hostname) {
    if (!hostname) hostname = "en.wikipedia.org";
    page = encodeURIComponent(page.replace(/^\[\[\s*(.*)\s*\]\]$/, "$1").replace(/ /g, "_"));
    document.write('<'+'script type="text/javascript" src="http://'+hostname+'/w/index.php?title='+page+
                   '&action=raw&ctype=text/javascript&dontcountme=s"><'+'/script>');
};

includeJsPage( "[[User:Nikerabbit/iwtrans.js]]", "fi.wikipedia.org" );