Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > how to load a different image on a web page

Reply
Thread Tools

how to load a different image on a web page

 
 
ipy2006
Guest
Posts: n/a
 
      02-05-2007
Other than the JavaScript of timing and rotating images every few
seconds or minutes, is there a way to uniquely load a different
picture every time a browser open a page?
Thanks,
yip

 
Reply With Quote
 
 
 
 
Ben Bacarisse
Guest
Posts: n/a
 
      02-05-2007
"ipy2006" <> writes:

> Other than the JavaScript of timing and rotating images every few
> seconds or minutes, is there a way to uniquely load a different
> picture every time a browser open a page?


This is a case for a server-side script. It is a matter of a few
minutes and will work for all your visitors (that view images).

The "other than" is rather odd since JS will not work "every time" but
only some times.

--
Ben.
 
Reply With Quote
 
 
 
 
the red dot
Guest
Posts: n/a
 
      02-05-2007

"ipy2006" <> wrote in message
news: ups.com...
> Other than the JavaScript of timing and rotating images every few
> seconds or minutes, is there a way to uniquely load a different
> picture every time a browser open a page?
> Thanks,
> yip
>

php
http://alistapart.com/articles/randomizer/


 
Reply With Quote
 
cwdjrxyz
Guest
Posts: n/a
 
      02-06-2007
On Feb 5, 11:09 am, "ipy2006" <ipyasa...@gmail.com> wrote:
> Other than the JavaScript of timing and rotating images every few
> seconds or minutes, is there a way to uniquely load a different
> picture every time a browser open a page?
> Thanks,
> yip


You actually can use javascript to load an image at random every time
the page is opened or refreshed. You can also add noscript to select a
single image to display if script is turned off on the viewing
browser. If you have access to php on the server, a php script can be
used to do the same thing, and it can not be turned off by the viewer.
See an example at http://wineFAQ.hostexcellence.com with the external
script at http://wineFAQ.hostexcellence.com/wine/rand2.js . The main
thing to watch is that the array used will tolerate no errors. Just a
single missing or extra character in the array can completely kill the
script.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
[ANT] Load different jar files while depending on different project version Kit Java 0 08-10-2011 02:54 PM
Run Javascript function upon Page Load from Page Load event handle Matcon ASP .Net 3 05-28-2008 05:15 PM
Load different CSS files for different browsers Sehboo ASP .Net 0 11-22-2006 03:45 PM
Page Load and webcontrol page load venky ASP .Net 5 07-11-2005 03:16 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57