if (window.DeviceMotionEvent) { window.addEventListener(‘devicemotion’,deviceMotionHandler, false); }