gpt4 book ai didi

javascript - 有人仍然对旧浏览器隐藏 JS 吗?

转载 作者:数据小太阳 更新时间:2023-10-29 04:28:05 26 4
gpt4 key购买 nike

还有人在用旧的吗

<!-- hide JS from old browsers -->

诡计?

我记得,这是针对使用 Netscape 或 IE4 的人。

我刚刚查看了我们的统计数据,在上个月,我们使用“Playstation Portable”作为用户代理(4 次访问)访问该网站的人数比我们使用 Netscape(1 次访问)的人数还多。

我什至在我的 javascript 中有“隐藏”东西有什么意义吗?

最佳答案

不,您不再需要这样做。

Crockford also says ...

Do not use the <!-- //--> hack with scripts. It was intended to prevent scripts from showing up as text on the first generation browsers Netscape 1 and Mosaic. It has not been necessary for many years. <!-- //--> is supposed to signal an HTML comment. Comments should be ignored, not compiled and executed. Also, HTML comments are not to include --, so a script that decrements has an HTML error.

关于javascript - 有人仍然对旧浏览器隐藏 JS 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5725551/

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