Archive for June, 2009

Enabling Scripts for IE 8+ and Firefox, Safari and Non-IE Browsers.

So we had this weird bug, that we were likely the culprit of, but that we didn’t have time to properly find/fix involving SWFAddress, and some JSON and IE 6 & 7. Namely with anything less then IE 8 inclusion of the SWFAddress javascript file was killing the app when we removed it, things worked fine, albeit without deep link or browser history support.

So we needed to have a way for IE8, Firefox, Safari, Chrome (why not even Opera) load SWFAddress, but the rest not, behold:

<!--[if gte IE 8]>-->
<script type="text/javascript" src="js/swfaddress.2.3.js"></script>
<!--<![endif>-->

Clever eh? it’s the extra -->s that do it, so all browers but IE ignore the only the (otherwise standard) conditional code, but still use the script, like we just put a couple of regular old comments up in there. This has only been tested on a few machines so your milage may vary. Lemme know if things workout (or don’t).