js实现打开网页设备判断
来源:互联网 发布:咪蒙致贱人 知乎 编辑:程序博客网 时间:2024/05/16 06:14
<!DOCTYPE html><html><head><meta charset=utf-8" /><title>js实现打开网页设备判断</title><script>/*判断打开设备*/var system ={ win : false, mac : false, xll : false }; //检测平台 var p = navigator.platform; system.win = p.indexOf("Win") == 0; system.mac = p.indexOf("Mac") == 0; system.x11 = (p == "X11") || (p.indexOf("Linux") == 0); var local= location.href;//跳转语句 if(system.win||system.mac||system.xll){//此处说明打开该网页设备为pc端alert("该设备为PC端");//若用移动端网址路径访问则自动跳转到对应pc端路径if(local=='http://www.centlight.com/mobile_web.html'){window.location.href="http://www.centlight.com/child_web.html";}else if(local=='http://www.centlight.com/mobile_ui.html'){window.location.href="http://www.centlight.com/child_ui.html";}else if(local=='http://www.centlight.com/mobile_php.html'){window.location.href="http://www.centlight.com/child_php.html";}else{window.location.href="http://www.centlight.com/";} }else{//此处说明打开该网页设备为移动端alert("该设备为移动端");//若用PC端网址路径访问则自动跳转到对应移动端路径if(local=='http://www.centlight.com/child_web.html'){window.location.href="http://www.centlight.com/mobile_web.html";}else if(local=='http://www.centlight.com/child_ui.html'){window.location.href="http://www.centlight.com/mobile_ui.html";}else if(local=='http://www.centlight.com/child_php.html'){window.location.href="http://www.centlight.com/mobile_php.html";}else{window.location.href="http://www.centlight.com/mobile.html";}}</script></head><body></body></html>
0 0
- js实现打开网页设备判断
- js判断打开设备
- JS判断网页是否在微信中打开
- JS判断移动设备最佳方法 并实现跳转至手机版网页
- JS实现点击网页判断是否安装app并打开否则跳转app store
- js 根据 useragent 判断访问网页的 设备 和 浏览器
- 利用Device.js判断设备进行网页布局
- JS判断移动设备 并跳转至手机版网页
- JS判断用户是否使用微信客户端打开网页
- js php,判断网页是否微信打开
- js判断是否在微信浏览器中打开网页
- js判断浏览器在PC中打开还是移动设备中打开
- js打开网页总结
- JS判断网页是在安卓打开还是IOS打开
- 判断打开网页的终端是什么设备(PC、手机等)
- js判断接入设备
- js判断移动设备
- JS用户端设备判断
- Linux TOP命令 按内存占用排序和按CPU占用排序
- 如何统计整个项目的代码行数
- github创建仓库并添加ssh key
- 《Android群英传》读书笔记
- 从零开始学web,每天写篇博客(日记)笑~
- js实现打开网页设备判断
- [转载]在linux上建SVN服务器
- windows 下 启动solr
- CodeBlocks中文版使用手册
- 中国国家顶级域名和国际域名的差别在哪里?
- 【C#】正则表达式
- Oracle建立表空间和用户、数据导入导出
- Unity中Temporal AA
- star gate 原理