【发布时间】:2017-02-09 21:39:19
【问题描述】:
我已经尝试了以下链接中的所有解决方案,但我无法使其工作。 How can I detect browser type using jQuery?
$(document).ready(function(e) {
$.browser.chrome = /chrom(e|ium)/.test(navigator.userAgent.toLowerCase());
if($.browser.chrome){
alert(1);
//this work well
}
else if(//the browser is IE){alert(2);}
else if(//the browser is Firefox){alert(3);}
)};
谢谢。
【问题讨论】:
-
为什么要了解浏览器?并发布与另一个已回答的问题完全相同的问题,要求重复关闭。而是显示您的实际代码不起作用,我们也许可以为您提供帮助。