admin管理员组文章数量:1302270
I am getting a weird error in some older versions of chrome, probably 2019 ( I am using an embedded chrome browser ) when I try to load google maps. It does not throw an error in the current versions of chrome.(2020 and onwards is fine) It has started all of a sudden.
<script src=";></script>
js?key=apikey:67 Uncaught SyntaxError: Unexpected token ?
I am really curious what might be the error is, can anyone shed light on this?
Thanks
I am getting a weird error in some older versions of chrome, probably 2019 ( I am using an embedded chrome browser ) when I try to load google maps. It does not throw an error in the current versions of chrome.(2020 and onwards is fine) It has started all of a sudden.
<script src="https://maps.googleapis./maps/api/js?key=apikey"></script>
js?key=apikey:67 Uncaught SyntaxError: Unexpected token ?
I am really curious what might be the error is, can anyone shed light on this?
Thanks
Share edited Aug 27, 2023 at 22:37 pmacfarlane 4,3453 gold badges12 silver badges32 bronze badges asked Aug 27, 2023 at 22:19 emre deliemre deli 1131 silver badge10 bronze badges 5-
Maybe try ...
js/?key=
, but I don't recall if a trailing slash was required – Phix Commented Aug 27, 2023 at 22:45 - @Phix that did not work unfortunately – emre deli Commented Aug 27, 2023 at 22:49
- 2 Likely Google doesn’t support that old version of chrome – Daniel A. White Commented Aug 27, 2023 at 22:54
- Is that an error from the browser or from the server? – Tim Roberts Commented Aug 27, 2023 at 22:56
- I would have expected a clear message from google if it was not supported anymore. It is an error from the browser. – emre deli Commented Aug 28, 2023 at 0:20
2 Answers
Reset to default 10I have the same problem. I have added "v=3.53" in url to force use an older version of the API. Google has update API on 18 August 2023. https://maps.googleapis./maps/api/js?libraries=places&key=...&v=3.53
This solution has solved my problem, I didn't want to update my electron app. Maybe this solution help you.
Google map v=3.53
is good quick fix. It won't work in long term because Google removing older version every quarter.
Current Google map failing in old browser (version 79 or older) because of null coalescing operator (??
).
??
It will work Chrome 80 or greater version.
本文标签:
版权声明:本文标题:javascript - Loading Google Maps, a weird error : Uncaught SyntaxError: Unexpected token ? in older versions of chrome - Stack O 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741705343a2393526.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论