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 |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
< | <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/g, 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/g, pageRandom); | |||
} | |||
} | |||
} | |||
} | |||
window.addEventListener("load", function(){assignRandoms();}); | |||
</script> | |||
</html> |
Latest revision as of 19:53, 9 March 2022