Home > Article > Web Front-end > How jquery determines the browser's core
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】.
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='text/javascript'> $(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!