js判断ios/Android,页面跳至对应页面
2015-12-14 16:07
501 查看
<!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>
当然,链接也可以相对应的是下载的页面
相关文章推荐
- JQuery1——基础($对象,选择器,对象转换)
- 使用C++实现JNI接口需要注意的事项
- Android IPC进程间通讯机制
- Android Manifest 用法
- [转载]Activity中ConfigChanges属性的用法
- Android之获取手机上的图片和视频缩略图thumbnails
- Android之使用Http协议实现文件上传功能
- Android学习笔记(二九):嵌入浏览器
- android string.xml文件中的整型和string型代替
- i-jetty环境搭配与编译
- android之定时器AlarmManager
- android wifi 无线调试
- Android Native 绘图方法
- Android java 与 javascript互访(相互调用)的方法例子
- android 代码实现控件之间的间距
- android FragmentPagerAdapter的“标准”配置