Javascript节点问题 [英] Javascript Node Issue

查看:64
本文介绍了Javascript节点问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于第一个小符号的错误,我有这个代码在FF中不起作用:

I have this code that doesn''t work in FF due to a bug with the firstchild bit:

< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号

推荐答案


我有这个代码在FF中没有用,因为第一个小符号的错误
I have this code that doesn''t work in FF due to a bug with the firstchild bit



这不是一个bug,这是IE出错的标准兼容行为。


你可以使用 .firstElementChild *而在FF中。

that’s not a bug, that’s standard compliant behaviour that IE gets wrong.

you can use .firstElementChild* in FF instead.

展开 | 选择 | 换行 | 行号


所以如果我要保持这样:
So if I was to keep its like this:
展开 | 选择 | Wrap | 行号


.firstEleme ntChild.nodeValue 始终是 null ,请参阅上面编辑的帖子以获取解释原因。
.firstElementChild.nodeValue is always null, see edited post above for an explanation why.


这篇关于Javascript节点问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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