Jump to content

refresh or 'loop' question?


simonp

Recommended Posts

Hi folks,

 

I have some code that checks if a server is online.

 

I want the code to check continually (ie every 1 second) - I know I could use a meta refresh but that's a bit clunky.

 

Is there a way I can setup a loop around the code that would do it more cleanly that meta refresh?

 

Hope this makes sense and someone can help!

 

Cheers

 

Simon

Link to comment
Share on other sites

Nah, AJAX isn't a scripting language it's a programming technique... that said:

 

You could use AJAX good sir! It is "a way of including content in a web page in which javascript code in the web page fetches some data from a server and displays it without re-fetching the entire page at the same time, hence the term 'Asynchronous'."

 

It's really hard to elaborate other than to tell you to use AJAX because it would be a lot of code to write. Google some tutorials on AJAX techniques. You'd just use javascript to retrieve the server statuses from a separate php script and then update the page the user is viewing with the result of the request.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.