title: How to detect network isReachable using phonegap (1.8.0)
body: <p>I am using the phonegap1.8.0 and I want to detect if the net is available and then if I could reach it. At the phonegap <a href="http://docs.phonegap.com/en/0.9.6/phonegap_network_network.md.html#Network" rel="nofollow">doc</a> expose the following api </p>
  
  <pre><code>navigator.network.isReachable('www.facebook.com', reachCallBack, {});
  </code></pre>
  
  <p>however, I got the </p>
  
  <pre><code>Console(4820): Uncaught TypeError: Object #&lt;Object&gt; has no method 'isReachable' at file:///android_asset/www/index.html:71
  </code></pre>
  
  <p>The code is:</p>
  
  <pre><code>    function netIsAvailable()
  {
      var reachCallBack = function (reachability)
      {
  
          var networkState = reachability.code || reachability;
  
          var states = {};
          states[NetworkStatus.NOT_REACHABLE]                      = 'No network connection';
          states[NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK] = 'Carrier data connection';
          states[NetworkStatus.REACHABLE_VIA_WIFI_NETWORK]         = 'WiFi connection';
  
          alert('Connection type: ' + states[networkState]);
  
      };
      alert(  navigator.onLine );
      navigator.network.isReachable('www.facebook.com', reachCallBack, {});
  }
  </code></pre>