Js determines the user's browser type

Source: Internet
Author: User
Tip: you can modify some code before running

Js determines the user's browser type<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.111cn.net/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>Js determines the user's browser type</title></head><body><div id='browser'></div><script language="javascript">Function getBrowser () {var s = navigator. userAgent. toLowerCase (); var a = new Array ("msie", "firefox", "safari", "opera", "netscape"); for (var I = 0; I <. length; I ++) {if (s. indexOf (a [I])! =-1) {return a [I] ;}return "other" ;}var br = getBrowser (); document. getElementById ('Browser '). innerHTML = br;</script>The original tutorial on this site is reproduced with the source www.111cn.net</body></html>
Tip: you can modify some code before running

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.