How do I load a specific js file according to the browser – in this instance for ie8?
Is there some kind of conditional I can do, much like browser specific CSS loading, that would appear in the head of the html?
Thanks in advance.
Printable View
How do I load a specific js file according to the browser – in this instance for ie8?
Is there some kind of conditional I can do, much like browser specific CSS loading, that would appear in the head of the html?
Thanks in advance.
Like this?:
Code:<!--[if IE 8]>
<script type="text/javascript" src="script8.js">
//Blah
</script>
<![endif]-->
That's great thanks Nile.
So if I need IE8 to load blah1.js and all other browsers to load blah2.js would it need some kind of if/else statement? I'm not really sure of the syntax though.
Cheers. :)
You only have to do this:===Code:<!--[if IE 8]>
Script for Internet Explorer 8
<![endif]-->
<!--[if lt IE 8]><!-->
Script for EITHER Internet Explorer lower_then_8 OR non-IE
<!--<![endif]-->
Arie Molendijk.
No actually... You only have to do this:
Code:<!--[if IE 8]>
<script type="text/javascript" src="blah1.js">
//Blah
</script>
<![endif]-->
<!--[if lt IE 8]><!-->
<script type="text/javascript" src="blah2.js">
//Blah
</script>
<!--<![endif]-->
Thanks guys, that's awesome. Works like a charm :)
Removed the reflection from MooFlow, as it was borked in IE8 and seems to be an outstanding unresolved issue.
Example