Example of Jquery.browser object to view browser-related information

Source: Internet
Author: User
Tags object version

Article Introduction: jquery detects browser name and version information.

In jquery, you can get information about your browser by accessing the properties of the $.browser object. The $.browser object is the Jquery.browser object that handles browser-related transactions, and the properties of the object are as follows:

Property name Description
Webkit True if the browser is WebKit related, False otherwise
Mozilla True if it is a Mozilla-related browser, False otherwise
Safari True if the Safari browser is False
Opera True if the browser is Operan, or false
Msie True if it is IE browser, false otherwise
Version Get the version number of the browser

The following is an example of viewing browser-related information:

<div id= "Tip" ></div>
<script>
    $ (function () {
        var browsertip = "Your browser name is:";
        if ($.browser.msie) {//ie browser
            browsertip + = "IE";
        }
        if ($.browser.mozilla) {//Firefox browser
            Browsertip + + Mozilla Firefox;
        }
        Browsertip + = "version number is:" + $.browser.version; Gets the version number
        $ ("#tip"). HTML (browsertip);
    })
</script>


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.