Reputation: 1
I need to detect the browser with JavaScript.
I have an image gallery with different js files for FireFox, Chrome, and IE. How can I detect the browser display the corresponding file?
Upvotes: 0
Views: 182
Reputation: 360016
You could also use conditional comments in the HTML to grab entirely different script files:
<!--[if IE]>
<script src="http://example.com/ie-specific.js"></script>
<![endif]-->
<!--[if !IE]> -->
<script src="http://example.com/real-browsers.js"></script>
<!-- <![endif]-->
Upvotes: 1