In Javascript, how do I determine if my current browser is Firefox on a computer vs everything else?

后端 未结 13 1888
萌比男神i
萌比男神i 2020-12-01 07:13
if(firefox and is on a computer){
alert(\'using firefox on a computer\')
}else{
alert(\"using something else!\");
}

How can I do this?

13条回答
  •  悲哀的现实
    2020-12-01 08:02

    You can make the control with javascript's navigator.userAgent or navigator object in general,

    But if you want to use something ready to go, check this:

    http://www.quirksmode.org/js/detect.html

    hope this helps, Sinan.

提交回复
热议问题