json – I am trying to enter a piece of JS Code into a .html document as asked. When i do so the js part doesnt seem to read
var aud = new Audio();
var Random = randomNumber(1,2); // Format for this function is randomNumber(min, max)
aud.src=”https://wordpress.stackexchange.com/questions/414001/music/Loading” + Random + ‘.ogg’; // I’ve put the loading files into ‘music’ folder and named them Loading1.ogg, Loading2.ogg .e.t.c
aud.play();
function randomNumber(myMin,myMax)
{
return Math.floor(Math.random()*(myMax-myMin+1)+min);
}
Noah is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Leave an answer