« Blog Home

§ Don't AJAX an image!

Using AJAX is fine when you need it, but I've used AJAX to simply reload CAPTCHA images.  Boy, some people are dumb!  Me, in particular.

UPDATE:  I'm dumber than I thought...

Referring to the code below, why waste time getting the time?  Just do:

function reload_image() {
  document.getElementById("rndimg").src+=1;
}

 Instead of AJAX, just change the src of the img tag.  This is what I use for CAPTCHA images now.

function reload_image() {
  var currentTime = new Date()
  document.getElementById("rndimg").src+=currentTime.getTime();
}


Boy, some people are just dumb.  Me, in particular.  UPDATE:  Say it again...

 

last edited on May 30th, 2010 at 4:33 PM

Comments

No Comments Here. Add yours below!

Add your comment

Name:
Email: (Will not be displayed - Privacy policy)
Website:
Comments:
  random image I can't read it!
Give me a different one!
Verify Post: Input the text from the image above to verify this post (helps prevent spam)
 

« Blog Home

Comments

Maybe he wasn’t wise enough to receive wisdom.
Hermod (in Mimir’s Well), Norse Code, Greg van Eekhout