这是我的全部代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
</head>
<body>
</body>
<script>
alert(!!window.DeviceMotionEvent);
</script>
</html>
Run Code Online (Sandbox Code Playgroud)
在我的手机上,此页面提示“错误”。在我的桌面上,它提示“true”。我在本地主机上运行页面,只使用一个 python SimpleHTTPServer 并直接通过 WiFi 连接到 IP 和端口。我在三星 Galaxy S7 上使用移动版 Chrome 74.0.3729.157。
我完全不知所措。任何人都可以想出任何未定义的原因吗?谷歌在这方面没有给我任何信息。