js判断安卓 or ios
<script> document.querySelector('.download').addEventListener('click', function() { var ua = window.navigator.userAgent; if (ua.match(/Android[\s\/]([\d\.]+)/)) { alert('这是安卓机') } else if (ua.match(/(iPhone|iPad|iPod)/)) { alert('这是iphone') } }); </script>