var result = Object.prototype.toString.call(nodes);
return (
typeof nodes === 'object'
&&
/^\[object (HTMLCollection|NodeList|Object)\]$/.test(result)
&&
nodes.hasOwnProperty('length')
&&
(nodes.length == 0 || (typeof nodes[0] === "object" && nodes[0].nodeType > 0))
)
This works properly in Chrome, but throws error in IE8 (probably 7 too). Error is happening at return
line.
This I stole from somewhere on here (I'll keep trying to find the link). It's supposed to determine if a given object (nodes
) is a node list. Lots of results for this error, but none I could find for this case. Anything jump out at anyone?
Thanks!