Why doesn’t indexOf work on an array IE8?

Versions of IE before IE9 don’t have an .indexOf() function for Array, to define the exact spec version, run this before trying to use it: if (!Array.prototype.indexOf) { Array.prototype.indexOf = function(elt /*, from*/) { var len = this.length >>> 0; var from = Number(arguments[1]) || 0; from = (from < 0) ? Math.ceil(from) : Math.floor(from); … Read more

Running Internet Explorer 6, Internet Explorer 7, and Internet Explorer 8 on the same machine

I wouldn’t do it. Use virtual PCs instead. It might take a little setup, but you’ll thank yourself in the long run. In my experience, you can’t really get them cleanly installed side by side and unless they are standalone installs you can’t really verify that it is 100% true-to-browser rendering. Update: Looks like one … Read more

‘console’ is undefined error for Internet Explorer

Try if (!window.console) console = … An undefined variable cannot be referred directly. However, all global variables are attributes of the same name of the global context (window in case of browsers), and accessing an undefined attribute is fine. Or use if (typeof console === ‘undefined’) console = … if you want to avoid the … Read more

tech