Difference between revisions of "MediaWiki:Common.js"

From Networks of Care
Jump to navigation Jump to search
Tag: Replaced
Line 1: Line 1:
 
/* Any JavaScript here will be loaded for all users on every page load. */
 
/* Any JavaScript here will be loaded for all users on every page load. */
 +
 +
 +
 +
<script> //getting random coordinates for the pages
 +
 +
var coordinates = [];
 +
while(coordinates.length < 2){
 +
    var r = Math.floor(Math.random() * 1500) + 1;
 +
    if(coordinates.indexOf(r) === -1) coordinates.push(r);
 +
}
 +
 +
document.getElementById("coordinate0").innerHTML =coordinates[0];
 +
document.getElementById("coordinate1").innerHTML =coordinates[1];
 +
 +
</script>

Revision as of 14:28, 30 March 2020

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



<script> //getting random coordinates for the pages

var coordinates = [];
while(coordinates.length < 2){
    var r = Math.floor(Math.random() * 1500) + 1;
    if(coordinates.indexOf(r) === -1) coordinates.push(r);
}

document.getElementById("coordinate0").innerHTML =coordinates[0];
document.getElementById("coordinate1").innerHTML =coordinates[1];

</script>