IE hack could benefit from centralization

Written by Adrian Holovaty on March 9, 2004

Dean Edwards' IE7 is a hot topic on Web-development sites lately. A brilliant hack, it lets Web authors paste a single line of code into their HTML pages in order to "enable" certain advanced CSS and JavaScript functionality in Internet Explorer -- the browser that's fallen far behind Mozilla and Opera in compliance with new markup and scripting standards.

The single drawback of IE7 is its size. Taking advantage of it requires users to download a 10 KB file. So here's an idea: Why couldn't a trusted central authority -- mozilla.org or webstandards.org, for instance -- host the One True Version of this file, and ask Web developers to link to it? That way, users' computers would cache the file the first time it was downloaded.

Comments

Posted by Bjoern Graf on March 10, 2004, at 12:21 a.m.:

Good idea, but it would require that cross site scripting is enabled, because it's still real JScript :|

Breaking the code into modules to be able to include the used features or required ones only instead of all the glory.

Posted by Dean Edwards on March 10, 2004, at 1:27 a.m.:

I haven't posted on many forums/blogs but I'm posting on yours because I like both the ideas here...

... And they are both things I want to do anyway. It would be great if we could centralise this code. One single signed script. Also, I think the future of this solution is fragmenting into sub-solutions. Different fixes for differnet scenarios. I'll articalute this on my site very soon. Thanks mate! ;)

Posted by Craig Saila on March 10, 2004, at 5:43 p.m.:

I'd love to see Microsoft offer remuneration to Dean so they can use his work in the next update of Internet Explorer (due to arrive with the next Windows service pack)!

Posted by Chris Heisel on March 10, 2004, at 7:35 p.m.:

Adrian, great idea about having a single location for the file so that it gets cached.

I also like the idea about breaking it down into modules. If the modules also lived in One Single Place (tm) then we'd get the fix for IE that we need, a smaller file, and the benefits of caching.

Posted by Dean Edwards on March 11, 2004, at 3:47 a.m.:

i agree with craig!

also, chris, this is where i'm headed too.

the css file that hooks in the main behavior (that parses the main css), could be used as a configuration file to load other fixes. if i make a kind of open format, like this:

IE7 {

-ie7-box-model: auto;

-ie7-png: off;

-ie7-some-other-fix: on;

}

these switches can load some other behaviors or javascript fixes appropriate to the page. we centralise these fixes too. like an abstract browser layer...

what do you guys think?

Posted by Dean Edwards on March 11, 2004, at 4:23 a.m.:

actually this is better:

IE7 {

-ie7-png: url(erik-png.htc);

}

Posted by Adrian on March 11, 2004, at 6:39 a.m.:

Dean, I think that's a great idea. Certainly there'd be cases in which developers would want to activate only *some* of the IE7 features -- for legacy code, particularly. The more flexibility, the better.

Posted by Jimmy Cerra on May 30, 2004, at 4:22 p.m.:

Rememeber that there are cross-domain security considerations when using javascript - even MSIE's DHTML bevhaviors.

Posted by Stu on July 5, 2004, at 11:55 p.m.:

Hmmm a good plan... on the other hand, as its text I bet it compresses well for the transfer over modems...?

Comments have been turned off for this page.