function devicejudge() { /* 判断浏览器类型 */ let useragent = navigator.useragent; /* android 终端 */ let isandroid = useragent.indexof('android'); /* ios终端 */ let ios = (/(iphone|ipad|ipod|ios)/i.test(navigator.useragent)) if (isandroid > -1) { return 'android'; } else if (ios) { return 'ios'; } else { return 'pc'; } } function adlastdownappstyle() { const styles = ``; $('head').append(styles); } function lastdownapp() { adlastdownappstyle(); let download_dom = `
`; $('body').append(download_dom); } $(function() { let devicetype = devicejudge(); if (devicetype === 'android') { lastdownapp() } });