The DOM Node object defines a set of constants that can be used to identify the node type. These constants are available in Firefox (and, I would assume, all other Gecko-based browsers), but not in the Internet Explorer. The expression ...
if (node.nodeType == node.TEXT_NODE) { ... }
... which would be largely self-documenting thus has to be written as ...
if (node.nodeType == 3) { ... }
... unless you define the same constants in your JavaScript.
if (node.nodeType == node.TEXT_NODE) { ... }
... which would be largely self-documenting thus has to be written as ...
if (node.nodeType == 3) { ... }
... unless you define the same constants in your JavaScript.
1 comment:
Thanks! you saved my life!
Post a Comment