document.layers 嗅探什么浏览器?
我正在查看一些 20 世纪的 JS 代码,他们在代码中使用 document.layers
试图获取当前的关键代码。他们嗅探什么浏览器?
我即将用这样的代码替换代码:
var fn = function(event){
event = event || window.event;
var code = event.charCode || event.keyCode;
}
但我害怕破坏一些神秘的东西并释放邪恶
I am looking at some JS code from the 20th century, and they are using document.layers
in code that is trying to get the current key code. What browser are they sniffing for?
i am about to replace the code with something like this:
var fn = function(event){
event = event || window.event;
var code = event.charCode || event.keyCode;
}
but i am afraid of breaking something arcane and releasing the evil
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
document.layers
存在于 Netscape 4 中,包含所有
和
元素。它是真正的 DHTML 的早期先驱。
有关详细信息,请参阅此处。 (十岁)
document.layers
exists in Netscape 4 and holds all<layer>
and<ilayer>
elements.It was an early precursor to true DHTML.
For more information, see here. (Ten years old)
Netscape 4 无法显示任何现代网页,因为它完全缺乏 CSS 支持 - 因此,如果您放弃对此浏览器的支持,那么您不会破坏任何尚未破坏的内容。
Netscape 4 is not able to display any modern web-page due to it's total lack of CSS support - so if you drop the support for this browser then you are not breaking anything that isnt already broken.