当谷歌地图未在黑莓手机上显示时检测并显示错误消息

发布于 2024-10-04 07:58:19 字数 408 浏览 0 评论 0原文

经过研究,我发现谷歌地图(在网页上)不适用于大多数或全部黑莓手机。看来这是由于 Blackberry 浏览器上缺乏重要的 Javascript 造成的。

是否有任何代码可以用来检测地图是否显示在设备上并相应地发出错误消息。 (iPhone 和 Android 也是目标)

我尝试了类似下面的内容,但 Blackberry 有一些 Javascript 操作系统,“Hello World”已正确显示

<script type="text/javascript">
document.write("Hello World!")
</script>
<noscript>Your browser does not support JavaScript!</noscript>

After doing research I have discovered that Google Maps (on a webpage) will not work with most or all of Blackberrys. It appears that this is a result of the lack of significant Javascript on the Blackberry browser.

Is there any code that I can use to detect whether the maps are being displayed on a device and put up an error message accordingly. (iPhone and Android are targets too)

I tried something like the below but the Blackberry has some Javascript os the "Hello World" got dispalyed properly

<script type="text/javascript">
document.write("Hello World!")
</script>
<noscript>Your browser does not support JavaScript!</noscript>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

痴情 2024-10-11 07:58:20

我们让它发挥作用的唯一方法是设置一个在启动时触发的超时函数,该函数检查映射初始化后设置的变量。

如果设置了变量,则加载地图,如果没有设置,则不会加载地图。这可能是一个漫长的等待,但至少我们设置了一些可以提醒用户的东西。

The only way we got this to work was to set a timeout function that triggers on startup which checks a variable which is set after the maps have initialised.

If the variable is set then the map loaded and if not it didn't. It can be a long wait but at least we set something up where we could alret the user.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文