Widget:TriviaText: Difference between revisions
From Unforgotten Realms Wiki
Jump to navigationJump to search
imported>Pillowkeeper mNo edit summary |
imported>Pillowkeeper m Testing widgets |
||
| Line 1: | Line 1: | ||
< | <script> | ||
< | window.addEventListener("load", function () { | ||
</ | var list = new Array(); | ||
list[0] = "0"; | |||
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 i = Math.floor(Math.random() * list.length); | |||
document.write("<li>" + list[i] + "</li>"); | |||
var index = list.indexOf(list[i]); | |||
if (index > -1){ | |||
list.splice(index, 1); | |||
} | |||
} | |||
}); | |||
</script> | |||
Revision as of 15:58, 22 December 2016
<script> window.addEventListener("load", function () { var list = new Array();
list[0] = "0"; 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 i = Math.floor(Math.random() * list.length);
document.write("
"); var index = list.indexOf(list[i]); if (index > -1){ list.splice(index, 1); } } }); </script>


