Anti-Social Behaviors
Is your browser anti-social? Here is a simple test.
Overview
Trying to find a sneaky way of loading behavioral extensions (JavaScript) into IE7, I toyed with the following JavaScript embedded in a CSS style sheet:
html{behavior:expression(function(element){
// do something
// trash this expression
runtimeStyle.behavior = "none";
}(this))}
Well I said it was sneaky.
There are other CSS hacks similar to this. This differs from those I’ve encountered in the past in three ways:
- it uses the
behaviorproperty instead of the usualbackgroundproperty - it uses
expression()in place ofurl()
this avoids use of thejavascript:protocol which messes up on secure servers (https://) - Finally, we trash the expression after it has executed
this saves the expression from being endlessly evaluated.
I had to abandon (for now) this approach because I couldn’t get it to work in IE5.0. Oh well.
Shame to waste it though...
Browse Happy Popup
Upon exiting your site, visitors using Microsoft Internet Explorer 6.0 will experience an annoying DHTML popup window advising them to upgrade to a better browser. Other browsers will not be affected.
Remember. This only works on Internet Explorer 6.0 (nothing happens in other browsers).
examples:
- Internal link: nowhere
there’s nothing there... - External link: Living Can Kill You
don’t forget to come back! - External link: Glazblog
Just include a link to the noIE.css style sheet in your web pages
and all Explorer users will be prompted to upgrade their browser when they exit your site.
Because all the code is contained in a style sheet there is no additional configuration.
The popup itself exists as a separate HTML file that you can restyle for your pleasure. :-)
Get the popup: /download/
View the source code: noIE/src/
