It's probably better to debug the script, at least for IE8+.
If you really want to avoid loading a script on IE, though, I believe it's the only browser with ActiveXObject, so the simplest thing is probably just to put a guard around your code in mousehover.js:
if (typeof ActiveXObject !== "undefined") {
// IE, don't do the mouse hover stuff
}
Or if it's really important to you not to download that JS on IE, you can do that in two ways:
<script>
(function() {
if (typeof ActiveXObject === "undefined") {
var s = document.createElement('script');
s.src = "js/mousehover.js";
document.documentElement.appendChild(s);
}
})();
</script>
That will load the script only on non-IE. But note that any subsequent scripts you have will not wait for that script to load, so if there are dependencies, you'll need to watch for them.
or using document.write:
<script>
if (typeof ActiveXObject === "undefined") {
document.write('<scr' + 'ipt src="js/mousehover.js"></scr' + 'ipt>');
}
</script>
...which will maintain load order, but can't be used in XHTML.