Board Thread:Support Requests - Getting Technical/@comment-1738746-20151015061208/@comment-1757994-20151015192044

There are probably hundreds, if not millions, of variations of JavaScript clocks. The one on W3Schools is also probably one of the lamest I've seen. However, it's certainly possible to create your own clock on a Wikia wiki, once JavaScript editing ability is restored.

One thing you need to do is actually start the code running. Adding something like

 $(function {  if ($('#txt').length) {    startTime;  } });

at the end of the code you already have would do it. $(function) is a jQuery document.ready function that runs when the page is loaded. It tests to see if there is an element with the ID "txt" on the page and starts the clock if there is. Your Template:Clock could contain something like



whose only purpose is to put an element with ID "txt" on the page. (You should pick a better ID convention, too.) You don't actually need a template just for that, but your desired clock has a bit of formatting you could do in a template instead of in JavaScript, if you wanted.

See mw:Manual:Coding_conventions/JavaScript and http://api.jquery.com/.

W3Schools is OK for a simple quick reference, but I suggest https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference.