开发者

Different javascript files for different browsers

I would like to have two separated Javascript files. One for IE and another one for all other browsers. How would I do that?

<!--[if IE]>
<script type="text/javascript" src="js/ie.js"></script>
<![endif]-->


<!--[if ALL OTHER BROWSERS THAN IE]>
<script type="text/javascript" src="js/all.js"></script>
<开发者_Go百科![endif]-->


<!--[if IE]>
<script type="text/javascript" src="js/ie.js"></script>
<![endif]-->
<!--[if !IE]>-->
<script type="text/javascript" src="js/all.js"></script>
<!--<![endif]-->


$.getScript("js/" + ($.browser.msie ? "ie.js" : "all.js"));

That should be all you need to do.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜