同一后台、同一数据库、不同模板的电脑端与手机端网站而言,实现两个端首页跳转,如下代码即可:
<script type=”text/javascript”>
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 {
window.location.href = “https://www.yunsucheng.com/m/“;
}
</script>
评论0