Link to home
Start Free TrialLog in
Avatar of tmmet
tmmet

asked on

Check online/offline

Hi,
How can I check using javascript that I'm working online/offline(I'm using IE).
When the user clicks on a button and he has clicked/selected (Files--->WorkOffline),then,I should display an alert box like "Can't perform operations when you are offline".
Any ideas/suggestions will be greatly helpful for me.Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
so

<input type="button" onClick="if ( document.all && !navigator.onLine ) alert('Sorry, can\'t perform operations when you are offline'); else doWhatever()">

Michel

Avatar of tmmet
tmmet

ASKER

Hi,
Thanks for your immediate reply...
I would be glad if you help me out...
Whatever alert message I'm giving,is getting displayed...
After my alert message,
I want the browser message to get displayed...That is,message box to connect /to stay offline...
How to trap the browser message...
Any ideas/suggestions will be greatly helpful for me...
Thanks in advance.
See your other post...

Michel