Widget:TriviaText: Difference between revisions

From Unforgotten Realms Wiki
Jump to navigationJump to search
imported>Pillowkeeper
mNo edit summary
imported>Pillowkeeper
mNo edit summary
Line 8: Line 8:
window.addEventListener("load", function () {
window.addEventListener("load", function () {
var list = new Array();
var list = new Array();
list[0] = "'''[[Slippery Knuckles Malone]]''' does not recall his original name";
list[0] = "/'/'/'[[Slippery Knuckles Malone]]/'/'/' does not recall his original name";
list[1] = "1";
list[1] = "1";
list[2] = "2";
list[2] = "2";

Revision as of 16:19, 22 December 2016

  • <script> window.addEventListener("load", function () { var list = new Array(); list[0] = "/'/'/'Slippery Knuckles Malone/'/'/' does not recall his original name"; list[1] = "1"; list[2] = "2"; list[3] = "3"; list[4] = "4"; list[5] = "5"; list[6] = "6"; list[7] = "7"; list[8] = "8"; var fin = list.length; for (j = 0; j < 6; j++){ var ul = document.getElementById("trivia" + j); var i = Math.floor(Math.random() * list.length); ul.appendChild(document.createTextNode(list[i])); var index = list.indexOf(list[i]); if (index > -1){ list.splice(index, 1); } } }); </script>