</script> <script> var id = navigator.geolocation.watchPosition(success, error, { enableHighAccuracy: true, timeout: 5000, maximumAge: 0 }); </script> Stop Watching Get High Accuracy, Control Cache
the left-to-right tilt in degrees, where right is positive console.log(orientation.beta); // beta is the front-to-back tilt in degrees, where front is positive console.log(orientation.alpha); // alpha is the compass direction the device is facing in degrees }); </script>
guaranteed to be absolute relative to the earth }); </script> Chrome/Android Only <script> window.addEventListener('deviceorientation', function(orientation) { console.log(orientation.webkitCompassHeading); // orientation is guaranteed to be absolute relative to the earth }); </script> Safari/iOS Only