TIMEX TIMEX - 9 months ago 27
HTML Question

How do I include a javascript if it's IE, and another javascript if everything else?

I want to include

<script src="ie.js">
if the browser is IE.

Otherwise, include
for all other browsers.

How can I do this?


You can do this using conditional comments. Example:

<!--[if IE]>
    <script src="ie.js">
<!--[if !IE]><!-->
    <script src="all.js">