Explorer Destroyer
slayer99 writes "I came across Explorer Destroyer yesterday, which is a project that aims to increase the market share of Firefox in a slightly more proactive way than is usual. They provide some code which you add to your front page which presents a banner to IE users urging them to switch to using Firefox. As a bonus, you can potentially make some money via Google's Firefox referral program."
Why bother with scripts and such? All you need is IE's own conditional html comments.
function hasIE_phoneHome(image) {g .php?host='+location.host);
if (document.getElementById)
{
var img = document.getElementById(image);
}
else if (document.all)
{
var img = document.all[image];
}
else if (document.layers)
{
var img = document.layers[image];
}
img.setAttribute('src','http://getunder50.com/pin
}
No, <!-- is the beginning of an HTML comment, and --> is the end of one. IE sees the comment, then sees the conditional code and knows to include it (if it matches the right version). Other browsers simply see it as an HTML comment and don't show it.