Admin Forum:Javascript last URL (spoiler reveal choice)

I know almost nothing about javascript ( , , ). I want to be able to make a verbatim that outputs the previous URL, so if the previous URL is the "spoiler" page, it would show the content, if not it would link to it. The spoiler page would link to the last page. Thanks, Iggyvolz 01:19, March 24, 2012 (UTC)


 * ( , , ) have nothing to do with Javascript. If that's all you know, you don't really know anything about HTML either, since those things are HTML. 65.92.180.188 04:51, March 24, 2012 (UTC)


 * You want a complete solution, don't you? :)


 * Below is a little snippet from my jQuery grab bag. It's not exactly what you were asking for, but it serves the same purpose. It checks if the word "spoiler" appears in the page's title and if so, it blackens the page and displays a dialog that will either send the visitor back or reveal the page.

' +       ' ');        $('#no').click(function  { $('#dialog').remove; history.back; });       $('#yes').click(function  { $('#dialog').remove; $('#blackout').fadeOut(2000, function {                $('#blackout').remove;            }); });   } }); --
 * It seems not to be working. I put a tag around it, and that made the code dissappear. (Link to script, link to page) Thanks, Iggyvolz 13:43, March 24, 2012 (UTC)


 * There are no tags in Wikicode. You need to add the code to one of the dedicated JavaScript pages. --


 * Is this CSS or JS? Iggyvolz 14:47, March 24, 2012 (UTC)


 * JS --


 * I tried it on MediaWiki:Common.js, but nothing happened. I'll be back in about 2hrs, I can make you admin of the wiki to put it in if you want. Thanks, Iggyvolz 15:09, March 24, 2012 (UTC)


 * Okay. Make me an admin. But don't forget to remove my privileges afterwards! --
 * This page should work now. You might have to refresh your browser's cache and/or wait a while before it starts to work. --