Click to See Complete Forum and Search --> : Image's


b_simpson1999
10-02-2004, 03:20 PM
I have a lot of pictures and going to keep updaing them when i get the images i'm using a couple of onclick buttons to change this 1 picture into different version i.e Paint,Cartoon and life ect.. so when click on paint it change the 1 picture to paint or if i click cartoon it change the 1 picture to cartoon and i'm sure you get the point by now but what if click the paint button and the file doesn't exstite yet so it shows the placement for the picture i want to to load a default picture from a diferent file but keep the file name intack so that when i do upload the picture it just shows up. any help whould be nice if you can understand my problem lol

sciguyryan
10-03-2004, 06:14 AM
If you mean checking if the image exists BEFORE trying to load it Javascript does not have an ability to check the existance of files (For security reasons) but, PHP does have this ability for a local server.


RyanJ

Charles
10-03-2004, 07:17 AM
If sciguyryan is right about what you are up to, then JavaScript would work for a limited number of users. One would simply use the image's "onerror" handler to set the "src" attribute to the next URL. And I guess you could use the NOSCRIPT element to privide access to all of the possibilities. But I think that you will find that inelegant enough that you'll want to do this server side.

That is if sciguyryan is right. Myself, I remain unable to parse your request.

b_simpson1999
11-03-2004, 12:12 PM
never mind