How to make sure remote server is up and running?


I’m building a very simple app that relies on a remote server. I will use this app on many websites, so I decided to store it on one server (I have control of the remote server in question).

I need to make sure that this server is up and running, so in the case it’s not I can use a fallback.

Would it be a client-side approach? A server-side approach? My guess is to use a js snippet to do the job. If I’m correct, I’ll probably use jquery to perfom the task.


-jj. :slight_smile:

Is your app like a javascript widget? Are you using any backend code?

If it’s just js, you can check the existence of something you create in your script to see if the code is there.

(remote script)

var myObject = {};

(local script)

if (typeof myObject !== 'undefined') {
// do stuff
} else {
// fall back