jquery 判断当前设备是PC端还是移动端
$(function(){
var system = {
win: false,
mac: false,
xll: false,
ipad: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);
system.ipad = (navigator.userAgent.match(/iPad/i) != null)?true:false;
if (system.win || system.mac || system.xll ||system.ipad) {
} else {
some code;
}
})
jquery 判断当前设备是PC端还是移动端的更多相关文章
- JS判断当前设备是 PC IOS Andriod
JS判断当前设备是 PC IOS Andriod <script > window.onload = function(){ var isPc = IsPC(); var isAndroi ...
- js 判断移动设备、pc端、android、iPhone、是否为微信、微博、qq空间
varbrowser = { versions: function () { var u = navigator.userAgent, app = navigator.appVersio ...
- jquery判断移动设备代码片段;pc、iphone、安卓
$(document).ready(function () { /* 判断设备*/ var browser={ versions:function(){ var u = navigator.userA ...
- CoreThink开发(十一)首页控制器判断移动设备还是PC并做相应处理
在home模块Index控制器添加判断代码 application\Home\Controller\IndexController.class.php <?php // +----------- ...
- 判断使用设备是PC还是phone
<script type="text/javascript"> //如果是手机设备,则.. if(/Android|webOS|iPhone|iPod|BlackBer ...
- jquery判断当前设备是手机还是电脑并跳转
<script type="text/javascript"> var commonURL = 'http://xxxx.com/'; function mobile_ ...
- (原) Jquery 判断移动设备是IOS / Android系统
var u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > - ...
- js判断浏览设备是 手机端,电脑端还是平板端
console.log(navigator.userAgent); var os = function() { var ua = navigator.userAgent, isWindowsPhone ...
- Java判断访问设备为手机、微信、PC工具类
package com.lwj.util; import javax.servlet.http.HttpServletRequest; /** * 判断访问设备为PC或者手机--工具类 * * @de ...
随机推荐
- 搭建jeecg-boot项目运行
实验版本: 2.0.2(发布日期:20190708) 项目地址:https://github.com/zhangdaiscott/jeecg-boot 说明文档:http://jeecg-boot.m ...
- Linux服务器下对Oracle数据库expdp(导出)和impdp(导入)
紧接上篇文章,Oracle数据库架构已经创建完成,我的需求是:将老服务器上的数据库迁移到新的数据库上. 这就用到impdp(导入)操作. 要想实现对新数据库的impdp(导入)工作, 首先需要从老的数 ...
- Shiro学习笔记1 —— Hello World
1.创建一个Maven工程加载Shiro的jar包 <!-- junit --> <dependency> <groupId>junit</groupId&g ...
- x25, PF_X25 - ITU-T X.25 / ISO-8208 协议接口。
总览 #include <sys/socket.h> #include <linux/x25.h> x25_socket = socket(PF_X25, SOCK_SEQPA ...
- shell 命令 进程相关
1. 进程标识号PID 唯一性 pid 为0 内核进程,linux内核创建 pid 为1 init进程,系统最早创建的进程,init是所有用户进程的祖先 2. 查看系统进程信息 (1)[ ...
- lvs负载均衡连接
http://blog.csdn.net/zwz1984/article/details/45194377 http://blog.csdn.net/zwz1984/article/details/4 ...
- UVALive7461 - Separating Pebbles 判断两个凸包相交
//UVALive7461 - Separating Pebbles 判断两个凸包相交 #include <bits/stdc++.h> using namespace std; #def ...
- PHP算法之增减字符串匹配
给定只含 "I"(增大)或 "D"(减小)的字符串 S ,令 N = S.length. 返回 [0, 1, ..., N] 的任意排列 A 使得对于所有 i ...
- not registered via @EnableConfigurationProperties or marked as Spring component
利用@ConfigurationProperties(prefix = "")来绑定属性时报错: not registered via @EnableConfigurationPr ...
- arc098D Xor Sum 2
题意:给你一个数列,问有多少对(l,r)满足A[l]+A[l+1]+...+A[r]=A[l]^A[l+1]^...^A[r]? 标程: #include<bits/stdc++.h> u ...