title: Check if user device's GPS is on
body: <p>I am developing an app using jQuery Mobile with PHP. I am not using Phonegap or other frameworks. I need to find user's <code>geolocation</code>. If user device's GPS is off, then I cant get a location. now I need to find user device's GPS is on or off.</p>
  
  <p>this is what i using now.</p>
  
  <pre><code>function getLocation() {
    if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(showPosition);
    } else { 
      x.innerHTML = "Geolocation is not supported by this browser.";
    }
  }
  
  function showPosition(position) {
    var lat=position.coords.latitude;
    var long=position.coords.longitude;
  }
  </code></pre>