常用JS代码段 (JS获取地址栏get参数 JS判断手机访问等)
来源:互联网 发布:linux 文件夹大小排序 编辑:程序博客网 时间:2024/06/05 15:51
1.获取GET参数
function GetQueryString(name){ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r!=null)return unescape(r[2]); return null;}
2.判断设备
function checkMobile(){ var isiPad = navigator.userAgent.match(/iPad/i) != null; if(isiPad){ return false; } var isMobile=navigator.userAgent.match(/iphone|android|phone|mobile|wap|netfront|x11|java|opera mobi|opera mini|ucweb|windows ce|symbian|symbianos|series|webos|sony|blackberry|dopod|nokia|samsung|palmsource|xda|pieplus|meizu|midp|cldc|motorola|foma|docomo|up.browser|up.link|blazer|helio|hosin|huawei|novarra|coolpad|webos|techfaith|palmsource|alcatel|amoi|ktouch|nexian|ericsson|philips|sagem|wellcom|bunjalloo|maui|smartphone|iemobile|spice|bird|zte-|longcos|pantech|gionee|portalmmm|jig browser|hiptop|benq|haier|^lct|320x320|240x320|176x220/i)!= null; if(isMobile){ return true; } return false; }
0 0
- 常用JS代码段 (JS获取地址栏get参数 JS判断手机访问等)
- js 获取地址栏参数
- js获取地址栏参数
- js 获取地址栏参数
- JS获取地址栏参数
- JS获取地址栏参数
- js获取地址栏参数
- js获取地址栏参数
- js 获取地址栏参数
- js获取地址栏参数
- js获取地址栏参数
- JS获取地址栏参数
- js 获取地址栏参数
- js获取地址栏参数
- js获取地址栏参数
- js获取地址栏参数
- js获取地址栏参数
- js获取地址栏参数
- php实现微信公众号主动推送消息
- 工程质量的一些实践
- js操作excel方法
- 常见查找算法(Java实现)
- Oracle分页查询语句分析
- 常用JS代码段 (JS获取地址栏get参数 JS判断手机访问等)
- [LeetCode-Java]16. 3Sum Closest
- 使用CSDN-markdown编辑器
- Android_Note(一)——主题界面设计
- 常用排序算法之希尔排序
- 数据库三大范式
- Revit开发之获取房间边界
- Linaro GCC不支持arm926ej-s
- CentOS7 ping通 telnet不通