Template:Random: Difference between revisions

Template page
(Created page with "<includeonly>{{Mod|(({{#time:U}}+({{{2|{{#time:z}}}}}))*({{{3|67}}})+({{NUMBEROFARTICLES:R}} mod ({{{3|67}}})))|{{{1|100}}}}}</includeonly>")
 
No edit summary
Line 1: Line 1:
<includeonly>{{Mod|(({{#time:U}}+({{{2|{{#time:z}}}}}))*({{{3|67}}})+({{NUMBEROFARTICLES:R}} mod ({{{3|67}}})))|{{{1|100}}}}}</includeonly>
<html><script>
function assignRandoms() {
  let pageRandom = Math.floor(Math.random() * 1000);
  let frames = document.getElementsByTagName('iframe');
  frames = Array.prototype.slice.call(frames);
  for(let frame of frames) {
    if(frame.src !== undefined) {
      if(frame.src.includes('RANDOMHERE')){
        frame.src = frame.src.replace('RANDOMHERE', pageRandom);
      }
    }
  }
  let spans = document.getElementsByTagName('span');
  spans = Array.prototype.slice.call(spans);
  for(let span of spans) {
    if(span.innerText !== undefined) {
      if(span.innerText.includes('RANDOMHERE')){
        span.innerText = span.innerText.replace('RANDOMHERE', pageRandom);
      }
    }
  }
}
window.addEventListener("load", function(){assignRandoms();});
</script>
</html>

Revision as of 19:51, 9 March 2022