1

I'm looking for a plugin for a website that checks that status of an online server. No matter how much I searched, I could not find one that uses simple HTML or CSS. I cannot use PHP because Weebly doesn't seem to understand it.

I can use CSS, HTML, and Javascript. All I need is something that tells the user if the server is online or offline.

UltraStallion
  • 131
  • 1
  • 3
  • 10

1 Answers1

1

As sami kuhmonen said, you can make an ajax post and see if it fails:

EDITED
the html:

<div id="divtodiplaystatus"></div>

and the JavaScript:

        $.ajax({
            //your server url
            url: "http://google.com",
            type: "post",
            data: "onlinecheck",
            success: function(){
                //function if server's online
                document.getElementById("divtodiplaystatus").innerHTML = "Server is online!";
            },
            error:function(){
                //function if server's offline
                document.getElementById("divtodiplaystatus").innerHTML = "Server is offline :(!";
            }
        });
Tomas K
  • 361
  • 4
  • 17
  • I cannot add certain files to the website because my site is 3rd party hosted. I do not have root folder directory access. I can only add or remove HTML from the page itself. Is there a way to include that in an HTML string? (The server I'm trying to monitor is hosted by me however) – UltraStallion Apr 11 '15 at 21:08
  • So you can't add it in ? I don't know if there is a way to solve your problem only with html – Tomas K Apr 11 '15 at 21:15
  • So just midify the code and add an function to display a Text via JavaScript innerHTML.... I will update the answer – Tomas K Apr 12 '15 at 11:32