js检测到如果是手机端就跳转到手机端的网址代码
2024-09-06 11:21:18
if((/AppleWebKit.*Mobile/i.test(navigator.userAgent)||/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))&&window.location.href.indexOf("?mobile")<0)try{/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?window.location.href="http://m.zfnet.net":/iPad/i.test(navigator.userAgent)||(window.location.href="http://m.zfnet.net")}catch(e){}
最新文章
- C/C++ makefile自动生成工具(comake2,autotools,linux),希望能为开源做点微薄的贡献!
- PAT 1006. 换个格式输出整数 (15)
- 8. String to Integer (atoi)
- IOS 中的MVC设计模式
- tomcat安全设置
- [wikioi]数字三角形
- MemCached高级缓存
- iOS学习笔记1--在xcode6以上的版本中不使用storyboard以及部分控件使用
- Velocity(3)——#set指令
- QScintilla 编译
- BZOJ_4128_Matrix_矩阵乘法+哈希+BSGS
- Python内置函数(40)——map
- C++primer第一章(部分)
- 前端(一)之 HTML
- Java中包装类型和基本类型的使用场景(什么时候使用包装类型)(转)
- JDK8 特性详解
- POJ 2965 The Pilots Brothers&#39; refrigerator (暴力枚举)
- 树莓派3中运行Netcore2.0程序
- Double H4.0
- QuantLib 金融计算——QuantLib 入门