跳转php代码,打开域名跳转浏览器纯PHP代码已适配
安卓和IOS系统
已经做了安卓和IOS的适配。需要替换其中要跳转的⽹址,然后保存为php⽂件,在内访问即可实现⾃动跳转!<?php
error_reporting(0);
if($_GET['open']==1 && strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger')!==false){
header("Content-Disposition: attachment; filename=\"load.doc\"");
header("Content-Type: application/vnd.ms-word;charset=utf-8");
}
>
html>
Welcome
body,html{width:100%;height:100%}
*{margin:0;padding:0}
body{background-color:#fff}
.top-bar-guidance{font-size:15px;color:#fff;height:40%;line-height:1.8;padding-left:20px;padding-
top:20px;background:url(//gw.alicdn/tfs/TB1eSZaNFXXXXb.XXXXXXXXXXXX-750-234.png) center top/contain no-repeat}
.top-bar-guidance .icon-safari{width:25px;height:25px;vertical-align:middle;margin:0 .2em}
.app-download-btn{display:block;width:214px;height:40px;line-height:40px;margin:18px auto 0 auto;text-align:center;font-size:18px;color:#2466f4;border-radius:20px;border:.5px #2466f4 solid;text-decoration:none}
点击右上⾓ Safari打开
可以继续访问本站哦~
点此继续访问
var url = 'lw/'; //填写要跳转到的⽹址
document.querySelector('body').addEventListener('touchmove', function (event) {
event.preventDefault();
});
var UA = navigator.userAgent,
isAndroid = /android|st(UA),
isIOS = /iphone|ipod|st(UA) && !isAndroid,
isBlackBerry = /st(UA),
isWindowPhone = /st(UA),
isMobile = isAndroid || isIOS || isBlackBerry || isWindowPhone;
return {
isAndroid: isAndroid,
isIOS: isIOS,
isMobile: isMobile,
isWeixin: /st(UA),
isQQ: /st(UA)
};
代码转换})(window, document);
if(mobileUtil.isWeixin){
if(mobileUtil.isIOS){
url = "t.asczwa/taobao?backurl=" + encodeURIComponent(url); ElementById('BtnClick').href=url;
}else if(mobileUtil.isAndroid){
url = '?open=1';
var iframe = ateElement("iframe");
iframe.style.display = "none";
iframe.src = url;
document.body.appendChild(iframe);
}
}else{
place(url);
}
//setTimeout('WeixinJSBridge.invoke("closeWindow", {}, function(e) {})', 2000);
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论