Node.TEXT_NODE and IE7

后端 未结 1 764
南旧
南旧 2020-12-06 10:23

I\'ve some javascript that tests DOM node types against like this:

        if(node.nodeType == Node.TEXT_NODE) {

Of course, it all works fi

相关标签:
1条回答
  • 2020-12-06 11:25

    Unfortunately you are not missing anything.

    There is no Node constant in IE. Look here http://www.ibm.com/developerworks/xml/library/x-matters41.html at section "What else can you do with the DOM?".

    So either you define your own Node constant or you simply ask for

    node.nodeType === 3
    
    0 讨论(0)
提交回复
热议问题