globalthis is not defined 钉钉H5应用报错(手机端)

<head>
    <script>
        this.globalThis || (this.globalThis = this)
    </script>
    ...
</head>

思路是:既然全局上没有定义 globalThis 那我们就判断一下,如果没有的情况下,定义全局的一个 globalThis 指向全局 this 对象(也就是 window 对象)。
posted @ 2022-06-21 16:22  rmhy  阅读(513)  评论(0编辑  收藏  举报