<script src="~/Web/js/jquery-1.10.1.min.js"></script> <script> $(function () { window.location.href = /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? "/Mobile/index.html" : "/Home/WebIndex&quo…
<script type="text/javascript">(function() { //得到域名后缀 var path = location.pathname.split('/') path = path.pop(); var ua = navigator.userAgent.toLowerCase(); var bIsIpad = ua.match(/ipad/i) == "ipad"; var bIsIphoneOs = ua.match(/i…
if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) { //说明是移动端 } else { //说明是pc端 }…
<script type="text/javascript"> //移动端url跳转,自定义部分开始 function mobile_device_detect(url) { var thisOS = navigator.platform; var os = new Array("iPhone", "iPod", "iPad", "android", "Nokia", &qu…
var checkBrowser; function browserRedirect() { var sUserAgent = navigator.userAgent.toLowerCase(); var bIsIpad = sUserAgent.match(/ipad/i) == "ipad"; var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os"; var bIsMidp = sUserA…
<script type="text/javascript"> function GetRequest() { var url = location.search; //��ȡurl��"?"������ִ� var theRequest = new Object(); if (url.indexOf("?") != -1) { var str = url.substr(1); strs = str.split("&…
function IsPC() { var userAgentInfo = navigator.userAgent; var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"); var flag = true; for (var v = 0; v < Agent…
function IsPC() { var userAgentInfo = navigator.userAgent; var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; var flag = true; ; v < Agents.length; v++) { ) { fl…
<script>function uaredirect(murl){ try { if(document.getElementById("bdmark") != null){ return; } var urlhash = window.location.hash; if (!urlhash.match("fromapp")){ if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad|W…
很多时候也可以通过逻辑程序来进行判断,如PHP.JS是常用的两种识别访问设备类型的常用方法. 原理都是采用识别访问客户端的HTTP_USER_AGENT,然后进行关键字匹配进行确定设备类型,对于伪造HTTP头的就区分不出来了. 区分设备类型然后要做的就是能够针对不同设置显示出易于阅读的网页,具体可以研究响应式布局技术. 本文主要介绍如何通过php或js来识别终端类型. <?php class IsMobile { public static function isMobile() { $user…