how to load a different image on a web page

Discussion in 'HTML' started by ipy2006, Feb 5, 2007.

  1. ipy2006

    ipy2006 Guest

    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
     
    ipy2006, Feb 5, 2007
    #1
    1. Advertising

  2. "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.
     
    Ben Bacarisse, Feb 5, 2007
    #2
    1. Advertising

  3. ipy2006

    the red dot Guest

    "ipy2006" <> wrote in message
    news:...
    > 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/
     
    the red dot, Feb 5, 2007
    #3
  4. ipy2006

    cwdjrxyz Guest

    On Feb 5, 11:09 am, "ipy2006" <> 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.
     
    cwdjrxyz, Feb 6, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mad Scientist Jr
    Replies:
    7
    Views:
    1,195
    Emma Gumbdough
    Jun 30, 2004
  2. venky

    Page Load and webcontrol page load

    venky, Jul 6, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    3,169
    venky
    Jul 11, 2005
  3. Sehboo
    Replies:
    0
    Views:
    498
    Sehboo
    Nov 22, 2006
  4. Matcon
    Replies:
    3
    Views:
    21,692
    Matcon
    May 28, 2008
  5. Kit
    Replies:
    0
    Views:
    351
Loading...

Share This Page