I the question was 'How to detect we are online or offline", there is
quite an easy way to do it.

Simply ask for a static ressource on the server, like an empty html
file, via an AJAX request (you can use HttpRequest from Gears as
well).
This resource has to stay on the server and must not be available
offline.

If the server answers back (status = 200, OK), then you're online else
you're not.

When you send these request while offline, you may get some
exceptions. Use a try/catch. I think we can assume that when an
exception appends we can consider that we are offline.

On 6 mar, 10:40, 浩翔 <[email protected]> wrote:
> Anybody ?
>
> On Mar 6, 4:56 pm, Alex <[email protected]> wrote:
>
> > Hi all,
>
> >        Do you know how to judge online and offline state correctly ?
>
> >        Thank you !
>
> > Alex

Reply via email to