js 获取浏览器型号

    xiaoxiao2021-12-14  19

    根据浏览器获取iphone和apk的下载地址 <!DOCTYPE html> <html> <head>     <meta charset="utf-8" content="text/html"/>     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">     <title>测试</title>     <style type="text/css">            </style>         <script type="text/javascript"> function getbrowse() { var useragent = navigator.userAgent; document.getElementById("phone").value=useragent; if(useragent.indexOf("iPhone")>-1){ window.open('https://itunes.apple.com/cn/app/xxx/xxx?mt=8&ls=1'); return; } if(useragent.indexOf("Linux")>-1){ window.open('xx.apk'); } } </script> </head> <body οnlοad="getbrowse()">    <div >         <label>型号</label><input id="phone" name="phone" style="width:500px" value=""  />     </div> </body> </html>
    转载请注明原文地址: https://ju.6miu.com/read-965313.html

    最新回复(0)