废话不多说,直接上源码
1 <!DOCTYPE html>
2 <html>
3
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
7 <title>JS获取手机型号和系统</title>
8 </head>
9
10 <body>
11 <div id="app"></div>
12 </body>
13 <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
14 <script src="mobile-detect.min.js"></script> <!-- mobile-detect可以通过npm下载 -->