2011-10-07 157 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

? –