Web Analytics Made Easy -
StatCounter Veryifing A Link is available - CodingForum

Announcement

Collapse
No announcement yet.

Veryifing A Link is available

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Veryifing A Link is available

    Hi,

    I want to be able to have an image or some text (either will be fine) to show wether or not my home server is online. I want visitors to my website to be able to see wether or not my server at home is online, so they know wether or not they can download from me. I have created an image file that sits on my server saying that i am online, and this shows on the website when the server is online, but when it is offline, the image does not display .

    Anyideas on how i can verify if a link works?

    Thanks a lot
    Last edited by pastorOfMuppets; Jul 2, 2002, 01:40 AM.

  • #2
    hmm no responses , Does anyone think that this is outside the range of Javascript?

    Thanks all!

    Comment


    • #3
      <img src="http://someip/serverup.gif" alt="Server status" onerror="alert('Server down!')"/>
      jasonkarldavis.com

      Comment


      • #4
        Thnks JKD

        Comment


        • #5
          To JKD: That seems to work rather well if the server is down the first time I try it, but what if it was once up, the image was cached, and the server is now down?
          Having said that, I've probably told you more than I know.

          Comment


          • #6
            try this:

            <script>
            var timeout;
            function online() {
            document.images['status'].onerror = 'path/to/offline.gif';
            document.images['status'].src = 'path/to/online.gif';
            setTimeout('online();', 30000);
            }

            window.onload = function() { setTimeout('online();', 30000);
            }
            </script>

            <IMG NAME="status" SRC="about:blank;">

            didn't test it at all, but in theory, that will check if your server is online every 5 minutes, and update the picture accordingly. also, instead of alerting, it loads another picture into your image tag, if you're offline.
            bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

            i am a loser geek, crazy with an evil streak,
            yes i do believe there is a violent thing inside of me.

            Comment


            • #7
              WOW! That's cool! Gives me some new ideas...
              Quيet Storm Designs ~ Art is not what you see, but what you make others see.
              · the Storms· || ·Ultraviolent Winter· || ·Was Einstein Wrong?· || ·It´s About Time!·

              Comment


              • #8
                I've just got to add:

                pastorOfMuppets is a very cool name... heheh

                Sounds like a Wierd Al "Metallica Parody" Album... LOL

                /me sings:

                "pastorOfMuppets is preaching to me... frogs can't go out with Miss Piggy... blinded by love it don't mean a thing... he just doesn't buy a cross-species ring... pastor! pastor!"

                Hehehe...
                Last edited by whammy; Jul 2, 2002, 08:31 PM.
                Former ASP Forum Moderator - I'm back!

                If you can teach yourself how to learn, you can learn anything. ;)

                Comment


                • #9
                  thanks to all the others for posting ideas, (espically the ones that have got something to do with the topic)

                  thanks!

                  Comment

                  Working...
                  X