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.
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.
Last edited by Snookerman; 06-05-2009 at 09:28 AM.
Like this?:
Code:<!--[if IE 8]> <script type="text/javascript" src="script8.js"> //Blah </script> <![endif]-->
Jeremy | jfein.net
andy@tcws (06-04-2009)
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.
Last edited by molendijk; 06-04-2009 at 09:59 PM.
andy@tcws (06-05-2009)
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]-->
Jeremy | jfein.net
andy@tcws (06-05-2009)
andy@tcws (06-05-2009)
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
Last edited by andy@tcws; 06-05-2009 at 10:43 AM.
Jeremy | jfein.net
Bookmarks