【发布时间】:2019-04-30 07:58:36
【问题描述】:
我正在尝试使用设备事件,例如 DeviceMotionEvent 和 DeviceOrientationEvent,但是当我尝试调试为什么它不能在我更新的 chrome 74 设备上工作时,结果发现上述事件没有被读取并且输出未定义而不是一个函数。
window.addEventListener('devicemotion', function (evt) {
console.log(evt);
});
window.addEventListener('deviceorientation', function (evt) {
console.log(evt);
});
【问题讨论】:
标签: javascript google-chrome mobile