Getting an absolute URL from a relative one. (IE6 issue)

How strange! IE does, however, understand it when you use innerHTML instead of DOM methods. function escapeHTML(s) { return s.split(‘&’).join(‘&amp;’).split(‘<‘).join(‘&lt;’).split(‘”‘).join(‘&quot;’); } function qualifyURL(url) { var el= document.createElement(‘div’); el.innerHTML= ‘<a href=”‘+escapeHTML(url)+'”>x</a>’; return el.firstChild.href; } A bit ugly, but more concise than Doing It Yourself.

Do HTML5 custom data attributes “work” in IE 6?

You can retrieve values of custom (or your own) attributes using getAttribute. Following your example with <div id=”geoff” data-geoff=”geoff de geoff”> I can get the value of data-geoff using var geoff = document.getElementById(“geoff”); alert(geoff.getAttribute(“data-geoff”)); See MSDN. And although it is mentioned there that you need IE7 to get this to work, I tested this a … 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

getElementsByClassName() doesn’t work in old Internet Explorers like IE6, IE7, IE8

IE6, Netscape 6+, Firefox, and Opera 7+ copy the following script in your page: document.getElementsByClassName = function(cl) { var retnode = []; var elem = this.getElementsByTagName(‘*’); for (var i = 0; i < elem.length; i++) { if((‘ ‘ + elem[i].className + ‘ ‘).indexOf(‘ ‘ + cl + ‘ ‘) > -1) retnode.push(elem[i]); } return retnode; … Read more

Inline block doesn’t work in internet explorer 7, 6

In IE6/IE7, display: inline-block only works on elements that are naturally inline (such as spans). To make it work on other elements such as divs, you need this: #yourElement { display: inline-block; *display: inline; zoom: 1; } *display: inline uses a “safe” CSS hack to apply to only IE7 and lower. For IE6/7, zoom: 1 … Read more