我正在尝试使用设备事件,例如DeviceMotionEvent和DeviceOrientationEvent,但是当我尝试调试为什么它无法在带有chrome 74的更新设备上运行时,结果是上面的事件没有被读取,并且输出未定义,而不是函数。
window.addEventListener('devicemotion', function (evt) {
console.log(evt);
});
window.addEventListener('deviceorientation', function (evt) {
console.log(evt);
});
Run Code Online (Sandbox Code Playgroud)