MediaWiki:Common.js: Difference between revisions

From MassiveCraft Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 10: Line 10:
var randomValue = a[Math.floor(a.length * Math.random())];
var randomValue = a[Math.floor(a.length * Math.random())];


var url = "<li><i>Read more <a href='http://wiki.massivecraft.com/" + randomValue[1] + "'>Here</a>."
var url = "<br><i>Read more <a href='http://wiki.massivecraft.com/" + randomValue[1] + "'>Here</a>."


document.getElementById("footer-info").innerHTML = document.getElementById("footer-info").innerHTML + li +  randomValue[0] + url;
document.getElementById("footer-info").innerHTML = document.getElementById("footer-info").innerHTML + li +  randomValue[0] + url;

Revision as of 02:00, 21 January 2016

/* Any JavaScript here will be loaded for all users on every page load. */

var a = [
	["One", "Fish"],
	["Two", "Fish"],
	["Red", "Fish"],
	["Blue", "Fish"],
	];
var li = "<li><b>Did You Know?</b> "
var randomValue = a[Math.floor(a.length * Math.random())];

var url = "<br><i>Read more <a href='http://wiki.massivecraft.com/" + randomValue[1] + "'>Here</a>."

document.getElementById("footer-info").innerHTML = document.getElementById("footer-info").innerHTML + li +  randomValue[0] + url;