in reply to [untitled node, ID 176516]


Samn,
Most peeps these days have JavaScript.
Just throw in an onError thingie into the img tag as shown below.
<image src="http://www.domain.com/webcam.jpg" width="320" height="240" + name="jer" border="0" onError="javascript:document.images.jer.src='/webcam/nowebc +am.gif';">
This will show your friend's web cam pic, or show your default pic if it doesn't return anything to your browser.
The code works fine on my site here

-Silent11

Replies are listed 'Best First'.
Re: Testing URL existence
by hacker (Priest) on Jun 23, 2002 at 12:29 UTC
    Most "peeps", actually do not have javascript, and in fact, a majority of browsers do not support it. With all of the issues lately with Javascript-level insecurities, spyware, cookie exploits, etc. many people (wisely) keep Javascript disabled. At least we now have browsers such as Mozilla that can apply a more granular control to Javascript

    Remember, Javascript is executed, not parsed. In any case, it won't work with text browsers (lynx, links), won't work with fast GUI browsers such as Dillo, and won't work on WAP/PDA/cell users. It's also a client-side solution, which means you rely on the client having it enabled, and using a browser which can properly execute the code you put in it.

    Rule 1: Never trust the client browser.

      While I avoid javascript like the plague, I do think "89% enabled" would be considered "most" by the majority.

      In this application, it's images the poster is worried about so lynx && links are moot points, so are most WAP devices.

      While I don't know what kind of cams the monk is linking to, Traffic, Personal or Voyeur :P cams but if it's just a cam links page on his personal website, the 30 second javascript might be appropriate.

      Don't get me wrong. I build large sites for a living and the only thing I will use javascript for is sized popup windows (Click here to see large image type of things) and even then it degrades nicely for people using AOHELL or who don't have javascript or have it disabled.
      My two cents.

      -Lee

      "To be civilized is to deny one's nature."