if(firefox and is on a computer){
alert('using firefox on a computer')
}else{
alert("using something else!");
}
How can I do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What you’re after is known as browser detection:
However, browser sniffing is discouraged, as its easy to spoof the user agent, i.e. pretend to be another browser!
You’d best use feature detection, either in your own way, or through the
jQuery.supportinterface: http://api.jquery.com/jQuery.support/Here’s an article on extending it for your own use:
http://www.waytoocrowded.com/2009/03/14/jquery-supportminheight/
Edit:
Found this post as well which helps: When IE8 is not IE8 what is $.browser.version?