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>


Related Article

Alibaba Cloud 10 Year Anniversary

With You, We are Shaping a Digital World, 2009-2019

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.