(function () { var href = window.location.href; var hostNamePC0 = 'en'; var hostNameMobile0 = 'enmobile'; // 移动端UA的正则 var reg = /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i; // 判断UA是否是移动端 var isUAMobile = navigator.userAgent.match(reg) !== null; // 判断URL是否是移动端 var hostName = window.location.hostname; var isURLMobile = hostName.split('.')[0] === hostNameMobile0; // 判断UA和URL是否匹配 if(isUAMobile !== isURLMobile) { // 不匹配的情况下跳转 if(isUAMobile) { window.location.href = href.replace(new RegExp(hostNamePC0,"i"),hostNameMobile0); }else { window.location.href = href.replace(new RegExp(hostNameMobile0,"i"),hostNamePC0); } } else {} })();

Top Stories

Latest News

Trending Topics

PR Newswire Updates

Webinars

Get insights from our webinars, where we invite editors, journalists, and PR leaders to discuss trends and developments in the APAC media industry.

Event News

Resources