News for hackers. Stuff that matters.
Re:IE6IFY by leviathant on Wednesday March 16, 2011 @05:31PM (#2334033)
This might actually be handy if it really did show what a page would look like in IE6. Instead, it comes across to me as a trivial CSS/JS novelty with a somewhat misleading name. Can I have those 10 seconds back?
Re:IE6IFY by originalgeek on Thursday March 17, 2011 @12:34AM (#2335084)
In defense of said website, I would like to point out that after clicking the IE6ify! button several times, in true IE6 fashion, the button stopped working.
Re:IE6IFY by ElbertF on Wednesday March 16, 2011 @07:48PM (#2334479)
The name was inspired by http://cornify.com, how is it misleading? I'd be happy to refund your 10 seconds.
Re:IE6IFY by plnewman on Wednesday March 16, 2011 @07:50PM (#2334482)
It doesn't actually simulate ie6, it just moves things around randomly (see comments below).
Re:IE6IFY by bauchidgw on Wednesday March 16, 2011 @07:54PM (#2334497)
which is a pretty good description of how ie6 renders pages.
Re:IE6IFY by rbanffy on Wednesday March 16, 2011 @09:23PM (#2334701)
Still, it's not accurate ;-)

edit: I doubt it's possible to be - that would imply duplicating the bugs in IE6, something I doubt even Microsoft could pull off.

Re:IE6IFY by kingsidharth on Thursday March 17, 2011 @09:54AM (#2336065)
C'mon! It's just a bit of fun!
Re:IE6IFY by yuhong on Thursday March 17, 2011 @03:25AM (#2335374)
Yea, can you really run IE6-only web apps using it?
Re:IE6IFY by Groxx on Thursday March 17, 2011 @03:16AM (#2335363)
I'll stick with Cornification, it's a lot more satisfying.

... can I have their 10 seconds?

Re:IE6IFY by robryan on Thursday March 17, 2011 @03:20AM (#2335369)
That actually sounds super hard, time would be much better spent on something that compensated for every one of these ie6isms, as opposed to this which is a bit of fun.
Re:IE6IFY by ElbertF on Wednesday March 16, 2011 @06:59PM (#2334338)
Oh cool, my half-hour project is on HN! I made this a year ago on my netbook while waiting for the bus. Interesting how my silliest ideas are the most successful ones.
Re:IE6IFY by ootachi on Wednesday March 16, 2011 @05:29PM (#2334025)
It'd be awesome if someone actually reverse engineered the algorithm and created a bookmarklet to reproduce it. This page [1] seems to have a lot of useful info.

[1]: http://www.satzansatz.de/cssd/onhavinglayout.html

Re:IE6IFY by sinaiman on Wednesday March 16, 2011 @05:28PM (#2334022)
Haha, nice one, this technology will surely be bought by Microsoft to support their anti-IE6 operations.

http://ie6countdown.com/

Re:IE6IFY by long on Wednesday March 16, 2011 @05:19PM (#2333975)
Very briefly, it works by randomly repositioning page elements.
Re:IE6IFY by nbpoole on Wednesday March 16, 2011 @05:34PM (#2334050)
Not quite. Here's the cleaned up JS from the bookmarklet:

    function () {
    var i = 0,
        r = function (n) {
            return Math.floor(Math.random() * n)
        },
        f = document.getElementsByTagName('body')[0].getElementsByTagName('*'),
        o = function (e) {
            return typeof(e.style) == 'object' && e.tagName != 'SCRIPT'
        },
        s = function () {
            while (!o(e = f[r(f.length)])) {}
            return e.style
        };
    while (i++ < 5) {
        s().display = r(2) ? 'block' : 'inline';
        s().position = r(2) ? 'absolute' : 'relative';
        s().margin = r(2) ? '0' : '1em';
        s().padding = r(2) ? '0' : '1em';
        s().width = r(2) ? '' : 'auto';
    }
    })();
Every time you click the button, it does the following:

1. Randomly selects an element from the page that isn't an object or a script.

2. Randomly switches the display property to either block or inline, the position property to absolute or relative, the margin property to 0 or 1 em, the padding property to 0 or 1em, and the width to a blank string or auto.

3. Repeats steps 1/2 until 5 elements have had these transformations applied.

Re:IE6IFY by armandososa on Wednesday March 16, 2011 @06:01PM (#2334158)
why use

    document.getElementsByTagName('body')[0]
instead of

    document.body
?

(it's a legit, not snarky, question )

EDIT: formating.

Re:IE6IFY by nbpoole on Wednesday March 16, 2011 @06:19PM (#2334218)
Because maybe there's more than one body? :P

[Seriously though, I have no idea]

Re:IE6IFY by generalk on Wednesday March 16, 2011 @10:25PM (#2334841)
You know, you're probably fine if you always assume there's only one body tag.

That said, I've seen this and worse when looking at the output of highly-paid web dev departments at large companies. One site we recently saw had five opening html tags, head sections, and body tags. All the head sections were different, and none were closed, including roughly half the content tags we saw. It's a testament to the "be loose in what you accept" mantra of the web, and to the browser devs themselves, that this monstrosity rendered properly.

I'm not saying "enterprise" developers are bad by definition, but the enterprise sure is large enough for the bad ones to sneak by.

Re:IE6IFY by long on Wednesday March 16, 2011 @07:59PM (#2334512)
getElementsByTagName always returns a NodeList, which is an Array-like object. You want the first thing in the array.
Re:IE6IFY by bauchidgw on Wednesday March 16, 2011 @07:59PM (#2334507)
there is nothing i havent seen before.... a multi million euro betting site (sponsor of real madrid) had this for years until i suggested it was a bad idea (and a lots of dev man days later......)
Re:IE6IFY by long on Wednesday March 16, 2011 @08:00PM (#2334517)
Props for typing up a more detailed version, which is what I started to do, but then got lazy and decided to make a somewhat vague general statement.
Re:IE6IFY by eschutte2 on Wednesday March 16, 2011 @05:40PM (#2334077)
Reminds me of my buddy Mats Bryntse's IE6Frame. He presented it at a meetup at Yahoo about a year ago:

http://mankzblog.wordpress.com/2009/11/13/ie6-frame-to-battl...

Re:IE6IFY by cypherpunks01 on Wednesday March 16, 2011 @05:58PM (#2334152)
More IE6 humor: the IE6 effect! http://mrdoob.com/lab/javascript/effects/ie6/
Re:IE6IFY by oniTony on Wednesday March 16, 2011 @05:40PM (#2334069)
It works even better after clicking the button a few times.
Re:IE6IFY by greattypo on Wednesday March 16, 2011 @05:30PM (#2334027)
This would be funny if it wasn't so true.
Re:IE6IFY by kaerast on Wednesday March 16, 2011 @05:27PM (#2334010)
I'm guessing @HipsterIE6 disapproves
Re:IE6IFY by barista on Wednesday March 16, 2011 @05:43PM (#2334086)
Why do people use @ mentions in places which don't support them?
Re:IE6IFY by jdub on Wednesday March 16, 2011 @05:46PM (#2334100)
To indicate they're talking about a Twitter user, without saying "The Twitter user, HipsterIE6", you humourless ninny.
Re:IE6IFY by scott_s on Wednesday March 16, 2011 @05:58PM (#2334148)
I've seen people using it here, when referencing a sibling post in a thread. I think some people have generalized it to mean "I'm talking about someone who I know will read this."
Re:IE6IFY by TeHCrAzY on Wednesday March 16, 2011 @06:33PM (#2334260)
http://vanillaforums.org use the format as a functional component. @Username in a post will (per target user settings) send them an email with a link to the post. Great way to drag specific people in to a thread.
Re:IE6IFY by SoftwareMaven on Thursday March 17, 2011 @12:56AM (#2335137)
I think it has genericized beyond Twitter to mean "somebody with a username of HipsterIE6". I've seen it on pretty much every site I visit to mean users on that site. Of course, then figuring out context becomes non-trivial: is this Twitter's HipsterIE6 or HN's HipsterIE6?
Re:IE6IFY by cgranade on Thursday March 17, 2011 @01:09AM (#2335156)
I miss using ~ to indicate usernames.