Home  >  Article  >  Web Front-end  >  How jquery determines the browser's core

How jquery determines the browser's core

coldplay.xixi
coldplay.xixiOriginal
2020-12-07 09:32:261946browse

The jquery method to determine the browser kernel: use conditional statements to determine, the code is [$(function(){if($.browser.msie) {alert("IE browser");}else if( $.browser.opera)alert("opera browser】.

How jquery determines the browser's core

The operating environment of this tutorial: windows7 system, jquery3.2.1 version, Dell G3 computer, the The method is applicable to all brands of computers.

Jquery method to determine the browser core:

<script type=&#39;text/javascript&#39;>
$(function(){
     if($.browser.msie) {
        alert("IE浏览器");
     }else if($.browser.opera) {
        alert("opera浏览器");
     }else if($.browser.mozilla) {
        alert("火狐浏览器");
     }else if($.browser.safari) {
        alert("safari浏览器");
     }
})
</script>

Related learning recommendations: javascript video tutorial

The above is the detailed content of How jquery determines the browser's core. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn