Is it possible to prevent the browser from parsing all javascript code present in a file if that browser is (for example, cough cough) ie8? I am curious if this is possible in a theoretical sense, as practically there are workarounds to my particular situation.
Here's what I mean:
(html)
<!--[if lt IE 9]>
<script type="text/javascript">
window.browser = 'bad';
</script>
<![endif]-->
(myfile.js, which with this code, literally won't run in ie8)
if(window.browser != 'bad')
{
ColorSpace.singletons = {
get gray() { //get is not correctly parse in <ie8
return shadow(this, 'gray', new DeviceGrayCS());
},
get rgb() {
return shadow(this, 'rgb', new DeviceRgbCS());
},
get cmyk() {
return shadow(this, 'cmyk', new DeviceCmykCS());
}
};
}
Thanks!
(Preemptive edit) For those who might think "wait! javascript is interpreted..." my response is: first the browser does some initial parsing such as splitting it into tokens and the token "get" in this case will break before the code has a chance to be interpreted because it's out of order as far as