1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

why random image.asp does not work for FF browser

Discussion in 'C#' started by 1why, Dec 30, 2006.

  1. #1
    I was asking to move this thread to programming > ASP
    No one helps me to movie, so I post it here now.
    -----------------------------------------------------

    Please help................

    Question > why random image.asp does not work for FF browser
    Problem > the second random image can not be load for FireFox

    several images file

    a-image.gif
    b-image.gif
    c-image.gif
    d-image.gif

    <img src="random-image.asp" >

    IE works but FF only can display the first load x-image.gif (x can be a, b ,c or d)

    after reload FF, it still display same image <--- why
    after reload IE, image can be changed randomly

    Thanks
     
    1why, Dec 30, 2006 IP
  2. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #2
    It's caching my brotha...

    A trick you can use is append a querystring onto the image load. It doesn't have to do anything - it just have to be a different imgae every time.

    So <img src="random-image.asp" > would become:

    <img src="random-image.asp?randid=1039204" >

    then

    <img src="random-image.asp?randid=9596823" >

    This should clear up the caching issuebecause browsers see it is a different image - this trick works with xml as well :)
     
    ccoonen, Dec 30, 2006 IP
    1why likes this.
  3. 1why

    1why Peon

    Messages:
    68
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks ccoonen,

    it is a nice way to do the random image.
    ------------------------------------------------

    however
    i have seen php site use
    <img src="random-image.php" > without "?="
    and it is running normal for FF and IE

    So please more helps
    is there any other way do
    <img src="random-image.asp" > for FF ?

    Thanks,
     
    1why, Dec 30, 2006 IP
  4. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #4
    try to disable the cache for your site or that specific page, in this case it would be "random-image.asp"

    use the HTML codes, or ASP headers to do it

    but the best solution for it ccoonen already provided to you

    I think this page might help you out to get a clue on it
    _http://www.velocityreviews.com/forums/t158557-how-to-disable-browser-caching-for-an-image.html
     
    ludwig, Dec 31, 2006 IP
  5. 1why

    1why Peon

    Messages:
    68
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for the response,

    My biggest problem is
    how to put the random image to my friend's site?

    how do I control randid ?
    can I still have the full control to disable my friend's browser caching ?

    I need to put a random image to http: // my friend's site .com
    <img src="http: //my site .com /random-image.asp" >

    is there any other way?

    thanks
     
    1why, Dec 31, 2006 IP
  6. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #6
    did you try disableing cache as I proposed?
     
    ludwig, Jan 2, 2007 IP
  7. 1why

    1why Peon

    Messages:
    68
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    not working for me

    I did try
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">

    I place the meta to the "random-image.asp"

    I also ask my friend add the meta.

    tried both but all not working.

    I have seen some php sites running very good.
    could php have more in control ?
     
    1why, Jan 2, 2007 IP
  8. 1why

    1why Peon

    Messages:
    68
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks,
    I got PHP code from a programmer Nico_swd (you can find at php forum)
    It works.

    But could some one
    Please help me to make the php code become asp code.

    Thank you.
     
    1why, Jan 3, 2007 IP