我正在使用 HTML5、CSS3 和其他新技术。
我想阻止我的用户以标准方式使用旧浏览器。
- 如何使用 JavaScript 或 PHP 检测旧浏览器?
- 如何正确向用户显示提醒?
最佳答案
该网站提供了一个易于使用的脚本,可以帮助您的用户以良好的方式升级他们的浏览器:
http://www.browser-update.org/
- Include our small javascript notification on your website
- Visitors with out-dated browser will be informed by a little, undisturbing bar, that his browser is not up-to-date and it is recommended to update.
- By clicking the bar, he will get to an info page with arguments why to change/update and some browser choices.
- If the visitor ignores the advice, it won't appear again for some time.
它不会阻止用户使用您的网站,只会通知他们他们的浏览器已过时,并尝试鼓励他们更新,而且会以谨慎的方式进行更新。
默认情况下,脚本将为一组推荐的旧浏览器提供此消息(当浏览器变得太旧时,会自动更新),但您也可以手动选择将在哪些浏览器上显示该消息。
您还可以自定义消息的外观。
关于javascript - 如何禁用旧浏览器的网站?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23054385/