您现在的位置是:首页 > 教程 > pbootcms教程pbootcms教程

pbootcms自动判断跳转到手机端的写法

秋荷2024-12-19 14:06:48pbootcms教程已有人查阅

导读function browserRedirect() {var sUserAgent= navigator.userAgent.toLowerCase();var bIsIpad= sUserAgent.match(/ipad/i) == "ipad";

<script>
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= sUserAgent.match(/midp/i) == "midp";
var bIsUc7= sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
var bIsUc= sUserAgent.match(/ucweb/i) == "ucweb";
var bIsAndroid= sUserAgent.match(/android/i) == "android";
var bIsCE= sUserAgent.match(/windows ce/i) == "windows ce";
var bIsWM= sUserAgent.match(/windows mobile/i) == "windows mobile";
if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
window.location.href='http://ebingou.cn/';
} else {
}
}
browserRedirect();
</script>
(function(){
try {
var urlhash = window.location.hash;
if (!urlhash.match("fromapp")) {
if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i))) {
window.location = "https://www.ebingou.cn/";
}
}
}
catch (err) {
}
})();

本文标签:

很赞哦! ()

留言与评论 (共有 条评论)
验证码:

相关标签