js判断ios/Android,页面跳至对应页面
16lz
2021-01-25
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,user-scalable=no"><title>指尖贷-借贷理财神器</title><style type="text/css">a{ text-decoration: none;}img{ display: block; margin: 0 auto; width: 100%; border: 0;}.btn{ width: 100%; position: fixed; bottom: 0; min-width: 320px; background: #fefefe; padding: 12px 0; color: #fff; text-align: center; line-height: 45px; border-radius: 3px; border-top: 1px solid #dcdcdc;}.btn a{ height: 45px; background:#25cffb ; color: #fff; display: block; width: 90%; margin: 0 auto; font-size: 18px; font-weight: bold;}</style></head><body><a href="javascript:void(0)" onclick="jump()"><img src="images/mayp-151214.jpg" /></a><div class="btn"><a href="javascript:void(0)" onclick="jump()">立即下载</a></div><script src="jquery-1.9.1.min.js"></script><script type="text/javascript">function jump(){var u = navigator.userAgent, app = navigator.appVersion;var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端或者uc浏览器var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端if(isAndroid==1){window.location.href="Android.html"}else(window.location.href="ios.html")}//alert('是否是Android:'+isAndroid);//alert('是否是iOS:'+isiOS);</script></body></html>
当然,链接也可以相对应的是下载的页面
更多相关文章
- Ubuntu 14.04下搭建 Android(安卓)开发环境(1) -JDK安装
- Android系统编译过程中常见问题汇总
- 解决移动端Web安卓机点击输入框,输入法遮挡输入框的问题
- Ubuntu 10.10 64bit下使用Android(安卓)NDK r6编译FFmpeg 0.8.1
- 移动端判断当前环境是否是微信、IOS、安卓
- 如何在Ubuntu12.1下安装Android(安卓)NDK(r8b)
- ubuntu 下android真机测试配置
- Android(安卓)抓包分析
- Android(安卓)studio报错rg.gradle.api.tasks.TaskExecutionExce