2011-10-07 114 views

回答

3

如果您已经在使用jQuery,您可以使用their API来检测浏览器。否则,您可以从navigator.useragent属性中提取用户浏览器。

+0

如果使用这样它会工作,我不明白ü –

1

你也可以使用conditional comments在HTML抢到完全不同的脚本文件:

<!--[if IE]> 
<script src="http://example.com/ie-specific.js"></script> 
<![endif]--> 
<!--[if !IE]> --> 
<script src="http://example.com/real-browsers.js"></script> 
<!-- <![endif]--> 
+0

? –