Random Linked Image Generator not working
-
I found this code online and added a couple of images to try and use it for my site. The code works fine when I test it on online HTML editors. But for some reason it won’t show on my WordPress page.
<html>
<head>
<title>Rotate</title>
</head>
<body><h1>Rotate</h1>
<script language=”JavaScript”>
<!–/*
Random Image Link Script- By JavaScript Kit(https://www.javascriptkit.com)
Over 200+ free JavaScripts here!
Updated: 00/04/25
*/function random_imglink(){
var myimages=new Array()
//specify random images below. You can have as many as you wish
myimages[1]=”https://ecx.images-amazon.com/images/I/81am4GQCKXL._SL1500_.jpg”
myimages[2]=”https://ecx.images-amazon.com/images/I/91TPmmUT5UL._SL1500_.jpg”//specify corresponding links below
var imagelinks=new Array()
imagelinks[1]=”https://amzn.to/1Kuc9Tu”
imagelinks[2]=”https://amzn.to/1FSN5FR”var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write(‘<img src=”‘+myimages[ry]+'” border=0>‘)
}
random_imglink()
//–>
</script></body>
</html>Any idea what could be going on?
- The topic ‘Random Linked Image Generator not working’ is closed to new replies.