Welcome to WebmasterWorld Guest from 54.162.164.247

Forum Moderators: open

Message Too Old, No Replies

Javascript to see if image exists

got one handy?

     
6:51 pm on Sep 25, 2002 (gmt 0)

Full Member

10+ Year Member

joined:July 1, 2002
posts:230
votes: 0


Anyone have a quick javascript that will check to see if a file exists? I can do this easily in ASP, however this is for a static HTML page. Any tips?

I need this to see if a file exists on a server, and to show it if it does, and if not , to show an image saying 'no image available' or something.

7:23 pm on Sept 25, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Sept 1, 2001
posts:4392
votes: 0


Silly question but, why not just write it with an ASP extension and use the ASP function?
7:26 pm on Sept 25, 2002 (gmt 0)

Full Member

10+ Year Member

joined:July 1, 2002
posts:230
votes: 0


cuz im lame.

heh.

7:27 pm on Sept 25, 2002 (gmt 0)

Full Member

10+ Year Member

joined:July 1, 2002
posts:230
votes: 0


anyhoo, long story. has to do with my boss being convinced html files get indexed good and asp one don't. shrug.
8:03 pm on Sept 25, 2002 (gmt 0)

Preferred Member

10+ Year Member

joined:May 9, 2001
posts:416
votes: 0


<img src="goober.gif" onError="document.write('Wrong-o. No such pik!')">

... if goober does exist, it will appear.
In a hurry to make an appt., sorry

T

8:07 pm on Sept 25, 2002 (gmt 0)

Full Member

10+ Year Member

joined:July 1, 2002
posts:230
votes: 0


dat's exactly what i needed.

thanks!

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members