Skip to content

Use Javascript to Display Random Image and Link

December 11, 2007

I was editing a PHP script today when I realised that one of the files did not allow PHP code. Weird. But the annoying thing was that I NEEDED it to run PHP code — or rather, I needed it to randomly display an image with a link.

So I had to find other means, which turned out to be good ol’ Javascript. The code below will allow you to use Javascript to randomly output or show an image with a link.

Download the Javascript here (Right click and save target as)

Related Posts.