SSL, IE < 8, remove, and background-image

SSL, IE < 8, remove, and background-image

If you're using SSL, and version of IE < 8 (includes IE 8 in compatibility mode) and you try to remove anything with a background image you get an SSL warning. This is a bug in IE that causes this warning for doing a number of different things, all other ways I've ran into are pretty trivial to work around. This particular one is more difficult since remove() is called in jquery all over the place internally.

A straight javascript workaround is to do:
this.outerHTML = "";
instead of:
this.parentNode.removeChild(this);

I had a basic override to jQuery.prototype.remove on jquery version 1.3.2 which corrected it  but this causes problems with jquery 1.4+ and replaceWith() and probably other methods.

I'm really hoping this can be fixed in jquery itself and that someone can give me a new workaround until it is fixed in the core.


Code to reproduce (must be using SSL)
  1. <html>
        <head>
            <script language="javascript" type="text/javascript" src="jquery-1.4.1.min.js"></script>
            <script language="javascript" type="text/javascript">
            $(document).ready(function()
            {
                $("div").bind("click", function()
                {
                    $(this).remove();
                });
            });
            </script>
        </head>
        <body>
            <div style="background-image:url('anyimage.jpg');width:50px;height:50px;"></div>
        </body>
    </html>