Recommended Answers
Jump to PostI think you'll need some server side code. Something that looks at a timestamp, a rolling counter, a database value, something... and automatically authors the appropriate image tag. Right now, I can't think of how you'd accomplish this with client scripting.
Jump to PostYou can use JS and a cookie...
Create a directory with images named ##.jpg
Then when the page loads read or set the cookie with that image id (##) the next time the page loads read the cookie and get the id ( ##) and then switch the …
Jump to PostDid you want a random page on refresh?
Server side would be better for this. But if you wanted to do it client side, then just have an array of URLs and use the document.location.href attribute (randomly selecting a loaction).
Of course you couldn't have the random href …
Jump to PostHi, I am trying to use the code example you provided for using javascript to display a random image. I implemented the code but my problem now is that IE with service pack 2 seems to block that part of the page as "active content" and you have to click …
Jump to PostThis script will load random images and they will change when you refresh. I hope this is what you are looking for:
Put in the head:
<SCRIPT LANGUAGE="JavaScript">
var theImages = new Array()//Random-loading images
theImages[0] = 'images/home_rotate1.gif' // replace with names of images
theImages[1] = 'images/home_rotate2.gif' // replace with …
All 21 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.