Anyway clever ways of checking whether an object is a nodelist in IE. There appears to only be two properties item and length.
This is what I’m working on
[CODE]// Some weirdness in IE regarding nodesList and typeof ‘item’ returning ‘Object’
// even though when alerted it returns ‘function (){…}’.
// Therefore having to use regExp.test() to check whether it’s a function instead.
// Note: _isNodeList isn’t full proof. An object with the properties
// {length: x, item : function(){}} will pass and return length.
var _isNodeList = function(obj){
var objType = {}.toString.call(obj);
return (objType === ‘[object NodeList]’ ||
objType === ‘[object HTMLCollection]’ ||
objType === ‘[object Object]’ && /^s?function/.test(obj.item))
&& obj.length; // returns length of nodeList if true
};
Cheers