IE8返回'应为对象'[].slice.call

IE8 returns 'Object expected' [].slice.call

本文关键字:slice call 返回 IE8 对象      更新时间:2023-09-26

我是js中的新手,这段代码在除li元素(选项卡)之外的所有浏览器上都能很好地工作。

	(function() {
	  [].slice.call(document.querySelectorAll('.tabs')).forEach(function(el) {
	    new CBPFWTabs(el);
	  });
	})();

有什么帮助吗?

IE8部分支持CCD_ 1,http://caniuse.com/#feat=queryselector

也请阅读:querySelectorAll用于IE 的可选项