开发者

Strange behavior in Firefox when nextSibling is a comment

I am pushing nextSiblings into an array inside a while loop. I know Firefoxe is different from IE in the way it picks up nextSibling (it treats whitespace and carriage returns as nodes). But when it picked up regular html comments it goes开发者_开发问答 into an infinite loop, like there are infinite nextSibling nodes that are comments. The solution was simple after I figured out what was happening (just check for nodetype and not push it into array if it's a comment) but I'm really curious if anyone else experienced this and why this is happening? Thanks you.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜