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.

reload captcha image - works in IE but not FF

Discussion in 'JavaScript' started by lanmonkey, Aug 7, 2008.

  1. #1
    my code is:

    <img id="captcha_iamge" src="Captcha.php" alt="" />
    
    <a href="#" onclick="document.getElementById('captcha_iamge').src = 'Captcha.php'" >Reload Image</a>
    HTML:
    the "reload image" will refresh the captcha image in IE but not FF. if firefox the link does nothing.

    any ideas?

    thanks in advance
     
    lanmonkey, Aug 7, 2008 IP
  2. codesome

    codesome Peon

    Messages:
    98
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    May be caching problem? Try this:

    <img id="captcha_iamge" src="Captcha.php" alt="" />
    
    <a href="#" onclick="document.getElementById('captcha_iamge').src = 'Captcha.php?'+Math.random();" >Reload Image1</a>
    or
    <div onclick="document.getElementById('captcha_iamge').src = 'Captcha.php?'+Math.random();" >Reload Image2</div>
    
    HTML:
    Works fine on IE, FF3.
     
    codesome, Aug 7, 2008 IP
    lanmonkey likes this.
  3. lanmonkey

    lanmonkey Active Member

    Messages:
    549
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    60
    #3
    SUPERB! works like a charm. +1 rep added

    safe to say I doubt I would have worked that out myself lol
     
    lanmonkey, Aug 7, 2008 IP