Convert NodeList to array

后端 未结 4 1629
不知归路
不知归路 2021-01-12 03:25

I\'m having a hard time converting a NodeList to an array in IE 8. The following works perfectly in Chrome, but in IE 8 toArray() is not recognize

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-12 03:49

    IE doesn't support NodeList in the standard way. This is why you should roll your own namespace and NOT extend browser core objects.

    You can do alert( typeof window.NodeList ) and see if it's undefined or not.

提交回复
热议问题