FANDOM


While regular links are certainly useful, you can add some extra niftyness with JavaScript links. On this page you can find a bunch of JavaScript recipes that you can simply copypaste.

Pretty much any kind of JavaScript utility can be launched from so this list is far from final. If you would like to add something, go ahead!

If JavaScript is not your thing and you want somebody to write a function for you, post your idea in the forum, please. I'll read everything you post and with a little luck others will jump in as well.

Useage is quite simple. Let's look at an example function. The steps you need to follow are the same for all other functions below.

1.) Copypaste the function from this page to your global.js (or where ever else you would like to use it.)

function example () {
    alert('This is just an example');
}

2.) Then Link to it from your like this:

* Example = javascript:example()

In other words: The link should look like this:

javascript: + <name of the function> + ()

The title is up to you, of course.

Open chat

Opens the chat window (where available)

function chat() {
    if (ChatEntryPoint && ChatEntryPoint.onClickChatButton) {
        ChatEntryPoint.onClickChatButton(true, '/wiki/Special:Chat');
    }
}

Purge and refresh

Clears the current page and all of it's contents from Wikia's cache and your browser's cache

 
function purge () {
    $.get('/wiki/' + wgPageName + '?action=purge', function () {
        location.reload(true);
    });
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.