Results 1 to 3 of 3

Thread: window.navigator.onLine is not working

  1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    30
    Vote Rating
    0
      0  

    Question window.navigator.onLine is not working

    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.

    Code:
    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.

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Vote Rating
    1524
      0  

    Default

    The browser should set this. Sencha Touch will not.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    44
    Vote Rating
    0
      0  

    Default

    And when we wrapped our SenchaTouch application with PhoneGap, would this command still work and look whether PhoneGap is online?

    Thanks in advance,

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •