博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
JS判断不同浏览器或设备来跳转不同页面
阅读量:7112 次
发布时间:2019-06-28

本文共 824 字,大约阅读时间需要 2 分钟。

  hot3.png

    var userAgent = navigator.userAgent.toLowerCase();    var platform;    if(userAgent == null || userAgent == ''){        platform = 'WEB' ;     }else{        if(userAgent.indexOf("android") != -1 ){             platform = 'ANDROID';            location.href = "http://www.diqiujiayuan.com/m/";        }else if(userAgent.indexOf("ios") != -1 || userAgent.indexOf("iphone") != -1 || userAgent.indexOf("ipad") != -1){             platform = 'IOS';            location.href = "http://www.diqiujiayuan.com/m/";        }else if(userAgent.indexOf("windows phone") != -1 ){             platform = 'WP';            location.href = "http://www.diqiujiayuan.com/m/";        }else{            platform = 'WEB' ;            location.href = "http://www.diqiujiayuan.com/";        }    }

转载于:https://my.oschina.net/docin/blog/201573

你可能感兴趣的文章
Java 为什么要使用反射(通俗易懂的举例)
查看>>
XSS是什么
查看>>
升级adt插件后,eclipse突然出现Unable to build: the file dx.jar was not loaded from the SDK folder 错误...
查看>>
github/python/ show me the code 25题(二)
查看>>
EasyMock入门
查看>>
线程池基础一
查看>>
5、struct2使用登陆的时候重定向功能,如果没有登陆,重定向到登陆页面
查看>>
JS-缓冲运动:菜单栏型悬浮框
查看>>
Unite 2018 | 《崩坏3》:在Unity中实现高品质的卡通渲染(上)
查看>>
HDU-4474 Yet Another Multiple Problem BFS搜索
查看>>
java在目录中过滤文件
查看>>
[转]重构36计
查看>>
C#调用Delphi写的动态链接库
查看>>
VS快速生成JSON数据类
查看>>
NOIP 飞扬的小鸟 题解
查看>>
hdu 4686 Arc of Dream 自己推 矩阵快速幂
查看>>
hdu 1754 I Hate It 线段树 单点更新 区间最值
查看>>
第四节:一些指令总结
查看>>
Delphi_检查exe文件是否是"随机基址"
查看>>
【Codeforces370E】Summer Reading [构造]
查看>>