Well I've got this little script:
<script>
window.addEventListener('deviceorientation', function(event) {
var a = event.alpha;
var b = event.beta;
var g = event.gamma;
}, false);
</script>
<script>
setInterval('alert(""+g+"");', '1000');
</script>
Which should add the deviceorientation
, attach it to the page, and alert every 1 second what the orientation currently is, the gamma.
It's not working, though? Nothing alerts! any tips... ideas...?
Edit: I get "Uncaught ReferenceError: g is not defined" in the console log... but it is defined!