how to add specific javascript file just for IE

0 votes
asked Mar 11 by katib (112 points)

I want to add a javascript file ie-only.js just for IE. how to do that.

After a little search i am doing something like this and its not working

<!--[if IE]>
<script src="ie-only.min.js"></script>

Any help

2 Answers

0 votes
answered Mar 11 by anonymous

I have tested following snippet

<!--[if !IE]><!--><script src="ie-only.js"></script><!--<![endif]-->
<!--[if IE]><script src="non-ie-only.js"></script><![endif]-->
0 votes
answered Jul 20 by Marvin (106 points)
Open up the Notepad or other simple text-editing software. ...
Start a basic HTML document. ...
Add a script tag to the HTML's head, and let the text editor know that you'd like to use a javascript language to write your HTML's javascript "program". ...
Make sure to end your HTML document. ...
Save your page. visit [college paper writing service][1]
Welcome , qPocho is an online community for programmers share there knowledge.