Forums: Admin Central Index → Watercooler → Help needed for a small script
Central's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
To contact staff directly or to report bugs, please use Special:Contact.
Note: This topic has been unedited for 4422 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.
Hi everyone.
I am making my first script for a wiki, and I want some help. I've made this script
/**********************/ /** Back to top test **/ /**********************/ //<source lang="javascript"> //A script that adds a "Back To Top" option in the footer of the Oasis theme. //I don't like scrolling back to top on long pages //Created by Noemon, based on code from SkinSwitchButton if( wgNamespaceNumber != -1 && !window.BackToTop ) { addOnloadHook( BackToTop ); } var BackToTop = true; // prevent duplication function BackToTop () { if ( skin == "oasis" ) { $('<li id="backtotop"><a href="'encodeURIComponent(wgPageName)+'#WikiaHeader">Back To Top</a></li>').appendTo('#WikiaFooter > .toolbar > .tools'); } } //</source>
as seen here, which is pretty much the SkinSwitchButton just for a different function.
I am asking you: Shouldn't my script work? What am I overlooking? Am I not importing it the right way? Since it's in my global.js shouldn't it be loaded everywhere? All corrections and advice are welcome. Regards --Noemon *talk* 03:29, March 11, 2012 (UTC)