shawnbot / aight

JavaScript shims and shams for making IE8-9 behave reasonably
Other
756 stars 98 forks source link

fix for chrome #3

Closed pedroteixeira closed 12 years ago

pedroteixeira commented 12 years ago

without this check for undefined, aight gives an exception in Chrome.

shawnbot commented 12 years ago

Hi Pedro, this isn't necessary because aight should not be loaded in modern browsers (such as Chrome). You should wrap aight's <script> tag in IE conditional comments, like so:

<!--[if lt IE 9]>
<script type="text/javascript" src="aight.min.js"></script>
<![endif]-->

This ensures that Chrome won't even download the script, which saves your users time and bandwidth.

pedroteixeira commented 12 years ago

Ok, thanks. But this differs from es5-shim which can be safely added in any browser. I just replaced es5-shim with aight, which contains it. But now, I would have to find out which browsers I also want to have it applied -- not sure if it's only IE. perhaps old Opera & Firefox also?

shawnbot commented 12 years ago

Ah, I see! That's a good reason to do this. Re-opening and merging, thank you!