« 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


It left my mouth with the force of honesty and vomit, but with the same despair as well.
Variable Star, Spider Robinson (& Robert Heinlein)