Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Ajax Programming

Detect network connection


Hi,

I was wondering if it's possible for Javascript to detect whether a
browser loses it's network connection.

For example, I press a button on a page, the browser connects to the
server, but the connection is lost whilst the server is processing.
After the timeout period, I get an error page. I would like to monitor
the connection while the server is processing and as soon as the
connection dies, just abort everything neatly and return the user to
the page where they pressed the button. They can then try again.
Currently the user sits there for 2 minutes waiting for the timeout
which is really bad.

Any ideas on how to do this (are there any js events for connections?)
would be greatly appreciated.  A solution only needs to work in IE6 as
that's the only browser the site officially supports.

Steve

On Jan 30, 11:47 am, "artig@gmail.com" <artig@gmail.com> wrote:

> Hi,

> I was wondering if it's possible for Javascript to detect whether a
> browser loses it's network connection.

> For example, I press a button on a page, the browser connects to the
> server, but the connection is lost whilst the server is processing.
> After the timeout period, I get an error page. I would like to monitor
> the connection while the server is processing and as soon as the
> connection dies, just abort everything neatly and return the user to
> the page where they pressed the button. They can then try again.
> Currently the user sits there for 2 minutes waiting for the timeout
> which is really bad.

When user clicks on a button, browser changes location of the current
window and that terminates all JavaScript. Please try replace regular
form submit with Ajax request. Or target form into an invisible frame
and monitor its state with <form target="..." ...>.

Sincerely,
Alexander
http://www.alexatnet.com/ - PHP/Ajax tips, notes, tutorials

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc