IE6 Frame to battle Chrome Frame?
So another day at work was destroyed by IE6, what else is new.
Google announced a while back that Wave won’t be supported on IE without the use of “Chrome frame”. This is basically the chrome browser injected into IE. So at Microsoft, they’re probably working hard on an IE6-frame to get some market shares back. This hypothetical addin would allow you to get the nice IE6 unexpectable rendering we all love so much in any non IE-browser. But why wait, I’ve just created a beta version of the IE6-frame. Sounds too good to be true? It’s not.
Here’s the code:
$(function() {
$('body *').each(function(i, el) {
ie6ize(el);
});
/*
Emulate IE-6 rendering
@param node, the poor node to get "the treatment"
*/
function ie6ize(node){
switch (Math.floor(Math.random()*11)) {
case 0:
$(node).css('float', 'left');
break;
case 1:
$(node).css('margin-left', '10px');
break;
case 2:
$(node).css('width', '102%');
break;
case 3:
$(node).css('height', '110%');
break;
case 4:
$(node).css('position', 'absolute');
break;
case 5:
$(node).css('display', 'inline');
break;
case 6:
$(node).css('color', '#fff');
break;
}
}
});
So what does this do for me you ask? See the before and after images below.
Ajaxian before:

Ajaxian IE6-ized:

Twitter before:

Twitter IE6-ized:

If you want to use this in a commercial application, please contact me at ……. no not really
Social comments and analytics for this post…
This post was mentioned on Twitter by dalmaer: Move over Alex Russell. IE6 frame is here!
http://bit.ly/1BfESn…
Haha, that’s awesome!
BTW, you should add
language="javascript"onto that sourcecode tag.Haha. Good stuff.
Too bad it’s not entirely over, yet.
As someone who used to suffer mightily trying to make things work in IE6, I got a serious laugh out of this, so many thanks. Now that I’m older and wiser, I simply refuse to support IE6, and I feel terribly sorry for anyone who has to.
Glad to make you laugh, topics including “IE6″ doesn’t tend to make developers laugh – rather the opposite
This code could be greatly simplified.
http://gist.github.com/234226
the switch/case could use a serious DRY pass to reduce size, and it is unfortunate jQuery passes the element as the second argument to each, otherwise you could pass a function reference rather than instantiating 2 new jQ objects in this simple code, one which is created for every element in the document ( $(node).css(..) )
I dare anyone to use this in a commercial application, only being enabled for browsers != IE6
Mats, I’ve simplified your excellent code and made it into a proper jQuery plugin:
http://gist.github.com/234256
- Ben
Excellent! Now if someone could send it over to mr Resig and get it published on the official jQuery plugins page, I’d be very impressed
And here’s a link to a Bookmarklet version of the plugin:
http://bit.ly/ie6ize
- Ben
[...] IE6 Frame to battle Chrome Frame? « Mankz’s Blog a few seconds ago from identichat [...]
[...] IE6 Frame to battle Chrome Frame? So another day at work was destroyed by IE6, what else is new. Google announced a while back that Wave won’t be [...] [...]
I LoLed
Mats, this is too funny.
Can I use it in newer versions of IE? (I.E., IE8)
I would like to use DirectAnimation and Gopher in IE8.