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

2019-02-28 11:04发布

问题:

This question already has an answer here:

  • IE8 Array.prototype.slice: 'this' is not a JavaScript object 1 answer

Im newbie in js, this code works good on all browser except li elements (tabs).

	(function() {

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

	})();

Any help?

回答1:

IE8 partially supports querySelectorAll(), http://caniuse.com/#feat=queryselector

read this too :querySelectorAll alternative for IE