There's a simple way to have a loading image without any javascript at
all.  Simply use CSS.  Either give the image in question a background
image which serves as your "loading" image (I've not tried this out so
am not sure it would work), or if that approach doesn't work, wrap
your image in another element (a div or span) and give that a
background image.

On May 27, 9:49 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote:
> I have a default image loaded into an img tag with an id of "specialImage".
> I also have a select box which displays a list of vehicles. The value of
> each option is a filename (75682.jpg, 75123.jpg, etc.).
>
> When the user selects a vehicle, I want to change the src of the img tag but
> I'm running into a few issues that I'm not sure how to get around.
>
> 1) Because I'm not using an AJAX call, I don't know if the file actually
> exists on the server. A few images are then showing as broken which is a big
> no no.
>
> 2) The images being loaded in aren't huge, but they might be 40k or so.
> Because I'm simply changing the src, I can't display a loading image while
> the requested image is loading.
>
> Are there ways around this? I'm thinking I could do an AJAX call to get the
> response headers for the file. When I trigger the AJAX call, I'd display the
> loading image. Then, if the response comes back 200, then I can display the
> actual file, if not, I can display a "no image available" image.
>
> Any thoughts on this method? Is there a better way to do this?
>
> ____________________________________
>
> Andy Matthews
> Senior ColdFusion Developer
>
> Office:  615.627.9747
> Fax:  615.467.6249www.dealerskins.com<http://www.dealerskins.com/>
>
> Total customer satisfaction is my number 1 priority! If you are not
> completely satisfied with the service I have provided, please let me know
> right away so I can correct the problem, or notify my manager Aaron West at
> [EMAIL PROTECTED]
>
>  2008 Email NADA.jpg
> 17KViewDownload

Reply via email to