Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using AJAX to detect offline/online status.

Status
Not open for further replies.

jpadie

Technical User
Nov 24, 2003
10,094
FR
Hello

i am looking for some scripts that can manage offline-v-online browsing. i.e. when the browser is online the page will pick up everything in its cache (i'm using the flash storage as a client-side information cache at the moment) and send it to the server for update. when the browser detects offline, then it will stop trying to send to the server and instead write the information to the clientside cache.

in case it's not obvious, this is for a data gathering app so the information flow is 90% client to server. i'm writing it as an AJAX page for cross browser and system compatibility. the page will be kept client side which will create cross-domain headaches but one step at a time.

all i am asking for in this thread is whether anyone has seen neat code or has any recommendations as to the offline/online switch - the scripting to the different end-stores and the remote update etc is all in hand. My *hope* is that it's as simple as storing a variable for the status and using the response-object (must be async by the way) to flick the switch. when the switch is off, a secondary process is kicked off every n seconds to test for online status. another btw - a whole bunch of functionality gets turned off in this website when it is offline!

tia
Justin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top