« 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

So all he had to do was learn some Norse magic.  Free Loki.  Find Liz.  Stop Ragnarok.  Help Sygin get her revenge on the lords of the Æsir.  Defeat the Krim, and get home.
Easy, really.
Jerry, Pyramid Power, Eric Flint & Dave Freer