SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict Robert_2006's Avatar
    Join Date
    Jun 2006
    Location
    Tarpon Springs Fl.
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Image Refresh in FF Yes in IE No

    I'm aware of how the cache can prevent images from updating, this is over come by appending random characters to the image. That's what I've done below. Yet it doesn't seem to function in IE. I need the value in id to be passed to verify-image.php. I have tried swapping the placement of ID and rnum but that had no effect. Do you guys have any ideas?

    Code:
    function reloadImage()
    {
       var id = document.form1.id_check.value;
       var rnum = parseInt(Math.random()*10);
       img = document.getElementById('Captcha');
       img.src = "./includes/verify-image.php?"+rnum+"&id="+id;
    
    }
    *http://www.sitepoint.com/forums/showthread.php?t=471396

    The Call
    Code:
    <a href="javascript:void(0)" onclick="reloadImage();">[REFRESH IMAGE]</a>
    Last edited by Robert_2006; Apr 28, 2007 at 09:53.

  2. #2
    SitePoint Addict Robert_2006's Avatar
    Join Date
    Jun 2006
    Location
    Tarpon Springs Fl.
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll settle for ideas or thoughts if you don't have an answer.

  3. #3
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why did you use parseInt()?

    I prefer using the following to generate a always changing string for that purpose.
    Code:
    (new Date()).getTime()
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  4. #4
    SitePoint Addict Robert_2006's Avatar
    Join Date
    Jun 2006
    Location
    Tarpon Springs Fl.
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The code came from an excististing chunk of code, I'm not a javascript guy if you can tell

    Changing it though yeilds the same results.

  5. #5
    SitePoint Addict Robert_2006's Avatar
    Join Date
    Jun 2006
    Location
    Tarpon Springs Fl.
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll buy anyone lunch (via paypal) if you have the solution...

  6. #6
    SitePoint Addict Robert_2006's Avatar
    Join Date
    Jun 2006
    Location
    Tarpon Springs Fl.
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Someone must have had the same issue before. Any thoughts?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •