<head>
<script>
this.globalThis || (this.globalThis = this)
</script>
...
</head>
思路是:既然全局上没有定义 globalThis 那我们就判断一下,如果没有的情况下,定义全局的一个 globalThis 指向全局 this 对象(也就是 window 对象)。
标签:定义,defined,H5,window,报错,globalThis,全局
来源: https://www.cnblogs.com/rmhy/p/16397274.html