开发者

DOM undefined error

I'm suddenly getting error like this on firebug. What开发者_StackOverflow do I look for? What does it mean?

nodes.item(i).getElementsByTagName("div")[0] is undefined


It means that there is no element under nodes.item(i) with the tagName div.


You've got a collection of elements in nodes. Apparently, you're looping through them with i. Then, IN EACH ONE, you're looking for any DIVs. If you find any DIVs, you're examining the first ("zero-th") one.

So, apparently, one of your item[i]s is missing the DIV that your brain thinks is there, but the computer says is not actually there.

And, since it can't find the "zero-th" one, that means there are NO DIVS AT ALL in that child.

So, look for that. :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜