现在document.all和document.layers已过时 [英] are document.all and document.layers obsolete now

查看:90
本文介绍了现在document.all和document.layers已过时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用某些(旧的?)本机javascript,遇到document.getElementById,document.all和document.layers的分离.

I am going through some (old?) native javascript and I encountered a separation of document.getElementById, document.all and document.layers.

据我所知,document.all和document.layers现在已经过时了,但我只是想确定一下.

From what I know, document.all and document.layers are obsolete now, but I just wanted to make sure.

推荐答案

是的,它们已经过时了.

Yes, they are obsolete.

document.all 集合特定于Internet Explorer. document.layers 集合特定于Netscape.两者都不在标准中.

The document.all collection is specific to Internet Explorer. The document.layers collection was specific to Netscape. Neither is in the standards.

今天,我们改用 document.getElementById .

另请参见: https://developer.mozilla.org/en-US/docs/Mozilla_Web_Developer_FAQ#JavaScript_doesn.E2.80.99t_work.21_Why.3F

这篇关于现在document.all和document.layers已过时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆