gpt4 book ai didi

html - 如何在客户端不使用 Chrome 时显示消息?

转载 作者:行者123 更新时间:2023-11-28 00:20:27 24 4
gpt4 key购买 nike

您还会在 Google 搜索主页上看到它。如果客户不使用 Chrome,您将看到 Chrome 的促销信息。当客户端已经在使用 Chrome 时,它​​不会显示。

我想在我的网站上实现同样的目标。如果客户端未使用 Chrome,那么我想显示一条消息。

"For Better View Use Chrome"

我怎样才能做到这一点?我正在使用 HTML5 和 CSS3。

最佳答案

您可以在 JavaScript 中检查 window.chrome

<script>
if (window.chrome) {
alert('chrome');
}
</script>

关于html - 如何在客户端不使用 Chrome 时显示消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9338492/

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