gpt4 book ai didi

Google 跟踪代码管理器中的 Javascript 编译器错误 : this language feature is only supported for ECMASCRIPT6 mode or better

转载 作者:行者123 更新时间:2023-11-30 14:46:03 25 4
gpt4 key购买 nike

我在 Google 跟踪代码管理器中收到以下错误消息:

Error at line 6, character 282: this language feature is only supported for ECMASCRIPT6 mode or better: block-scoped function declaration. Use --language_in=ECMASCRIPT6 or ECMASCRIPT6_STRICT or higher to enable ES6 features.

when adding this Intercom snippet tag

<script>
window.intercomSettings = { app_id: {{intercom_chat_widget_id}} };
</script>

<script>
(function () { var w = window; var ic = w.Intercom; if (typeof ic === "function") { ic('reattach_activator'); ic('update', intercomSettings); } else { var d = document; var i = function () { i.c(arguments) }; i.q = []; i.c = function (args) { i.q.push(args) }; w.Intercom = i; function l() { var s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://widget.intercom.io/widget/{{intercom_chat_widget_id}}'; var x = d.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); } if (w.attachEvent) { w.attachEvent('onload', l); } else { w.addEventListener('load', l, false); } } })()
</script>

对于这段代码i = function(){

最佳答案

这在 Google 跟踪代码管理器中对我有用:

<script>
window.intercomSettings = { app_id: {{intercom_chat_widget_id}} };
</script>

<script>
(function () { var w = window; var ic = w.Intercom; if (typeof ic === "function") { ic('reattach_activator'); ic('update', intercomSettings); } else { var d = document; var i = function () { i.c(arguments) }; i.q = []; i.c = function (args) { i.q.push(args) }; w.Intercom = i; var l = function () { var s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://widget.intercom.io/widget/{{intercom_chat_widget_id}}'; var x = d.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); }; if (w.attachEvent) { w.attachEvent('onload', l); } else { w.addEventListener('load', l, false); } } })()
</script>

这里改变的是

function l() { ... }

已更改为

var l = function () { ... };

关于Google 跟踪代码管理器中的 Javascript 编译器错误 : this language feature is only supported for ECMASCRIPT6 mode or better,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48922855/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com