if (("undefined" == typeof document.referrer || -1 === document.referrer.indexOf("http://m.meizu.com")) && navigator.userAgent.match(/android|webos|ip(hone|ad|od)|opera (mini|mobi|tablet)|iemobile|windows.+phone|mobile|fennec|kindle (Fire)|Silk|maemo|blackberry|playbook|bb10\\; (touch|kbd)|Symbian(OS)|Ubuntu Touch/i))
{
var pathname = window.location.pathname,
reg = /^\/?([a-z\-]*)\/?(?:\/index\.html)?$/,
langArr = ["", "en", "in"];
if (reg.test(pathname))
{
var lang = reg.exec(pathname)[1];
langArr.indexOf(lang) > -1 && (window.location.href = "http://m.meizu.com/" + lang)
}
}
这段代码是什么意思?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
判断网页语言,切换到相对应的移动版网页
检测是否是魅族网,且是手机等非台式设备。
若不是,那就以指定语言跳转到魅族网。
通过判断访问设备类型(PC,安卓,苹果等)加载对应的页面。
检查链接是否是魅族官网,访问设备是否那几个