I have a PHP script that opens a port and asks the server if it is running, with PHP I echo a "Server Running" or an error - I want to access this script with JQuery/AJAX. Then on the website, I have a little box on the side of the screen that pulls the results of this script every 5 seconds or so and shows the user if the server is running.
I've got everything figured out with the HTML, Here is the JS I have so far:
Inside of setInterval, the call to the php script works great but the message is always ' '. If I change the order of the lines inside setInterval to
$('#serverresultsloading').html('Checking...'); $('#serverresults').load('ajax-calls/serverstats.php'); $('#serverresultsloading').html(' ');
Then after 2 seconds I see "Checking..." but it never goes away.
So how should/can I go about this to get the desired result. I've tried a number of things, such as using wait(); with no results.
Thanks for your help