You are here: Re: how to load a different image on a web page « HTML « IT news, forums, messages
Re: how to load a different image on a web page

Posted by cwdjrxyz on 02/06/07 22:01

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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация