pc端页面新整理的两个小技巧
1、如果该页面只适合在电脑上进行浏览,请添加以下代码
<meta name="applicable-device" content="pc">
2、判断非移动端设备
javascript代码
(function () {
var ua = navigator.userAgent;
if (!(!ua.match(/iPhone|iPod/) && !ua.match(/Android/) && !ua.match(/iPad/))) {
window.location.replace('pc端页面');
}
})();
如果您觉得本文的内容对您的学习有所帮助:
关键字:
applicable-device navigator userAgent match window location replace