TIMEX TIMEX - 1 year ago 83
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?

Answer Source

You can do this using conditional comments. Example:

<!--[if IE]>
    <script src="ie.js">
<!--[if !IE]><!-->
    <script src="all.js">
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download