Alternate Images

liunx

Guest
I don't know if it's possible in HTML or JS, or PHP. People have told me you can do it in all, so I'm just trying HTML. Anyway, I don't have any experience in any languages other than HTML. But I need a script that displays an image, if it can't (404, red x, ect), it displays a different image. I mainly want to do this to show the status of my game server.<br />
<br />
Thanks for any help.<!--content-->This would probably require a server-side language... Although it's probably possible with Javascript...<!--content-->It looks like CMM is looking for money for help. I'll post on the Java board. I've seen someone do it before, and I believe he did it in JS. <br />
<br />
Thanks.<!--content-->Looking for money for help? We're not looking for money for help... I am a member of CMM that is helping you for free. Do you think I expect pay?<br />
<br />
By the way, I don't think this can be done with JavaScript. I really doubt it's possible without a server-side language to see if the file exists on the server.<!--content-->Ah, didn't know you were part of CMM :). Yeah, someone in the Javascript section told me that, and showed me a script. I tried it, but I don't know how exactly to use it, so I posted what I tried. Thanks for the help.<!--content-->You have to have a server that supports the language used, most likely PHP (if AdamBrill or Pyro replied :p).<!--content-->Well it could be done with PHP, is it supported?<!--content-->Probably a very late reply, but here's what I found in my spare time:<br />
<br />
<!-- m --><a class="postlink" href="http://webdeveloper.earthweb.com/webjs/item.php/90721">http://webdeveloper.earthweb.com/webjs/item.php/90721</a><!-- m --><!--content-->Ok..I just saw this thread...:D <br />
<br />
Here is how one can find out if the server is up or not using javascript..by the way its a hack,not a real language solution)..<br />
<br />
<!-- m --><a class="postlink" href="http://68.145.35.86/skills/javascripts/FindOutAServerIsUp.html">http://68.145.35.86/skills/javascripts/ ... rIsUp.html</a><!-- m --><!--content-->This can in fact be done simply with the OBJECT element.<br />
See <!-- m --><a class="postlink" href="http://www.w3.org/TR/html401/struct/objects.html#edef-OBJECT">http://www.w3.org/TR/html401/struct/obj ... def-OBJECT</a><!-- m --><br />
<br />
However, support for this element is very loose so it may take some fiddling to get it to appear like you want.<!--content-->
 
Back
Top