PDA

View Full Version : window.navigator.onLine is not working



pm.sreejith
19 Dec 2011, 12:45 AM
Hi All,

I'm trying to detect the network accessibility by using the command given below.
It returns true always even though the network was disabled.



if(window.navigator.onLine === true){
alert('You are in online');
}
else{
alert('You are in offline');
}


Also I would like to confirm that the code given above is related to ST 2.0 or common in Javascript. The problem was found with Chrome. In safari, it is working fine.

Any help would be greatly appreciated.

mitchellsimoens
19 Dec 2011, 7:27 AM
The browser should set this. Sencha Touch will not.

Tamuha
6 Mar 2012, 8:24 AM
And when we wrapped our SenchaTouch application with PhoneGap, would this command still work and look whether PhoneGap is online?

Thanks in advance,