« 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


Oppuk gazed down at the creature in disgust.  Not only had it forced its barbaric name upon him, it smelled of floral aromatics, which the denizens of this world often applied to themselves in the mistaken belief that the natural scents of their bodies were noisome, while blatant artificial odors were somehow more acceptable.
Oppuk, The Course of Empire, Eric Flint & K.D. Wentworth