I tested navigator.online and it worked until I built the app with PhoneGap, after that, navigator.online always returned true.
Does anybody know how can I un-cache or refresh this value? I need it on “on click” events.
I tested navigator.online and it worked until I built the app with PhoneGap, after
Share
I was also facing this issue while I was developing an application.
What I used is:
These events will be fired when the device is disconnected or connected to internet on the fly.
You can store some global variables in the function
and
Than check the values of those global variables and do whatever you want to according to the value.