运营狗 - JS跳转
https://blog.seo135.com/tag/JS%E8%B7%B3%E8%BD%AC/
-
手机站跳转PC站JS代码
https://blog.seo135.com/868.html
2020-05-22T11:56:00+08:00
大家用织梦自适应模板建站的时候,基本上会在PC端配置跳转手机站的JS代码,但是当PC端访问手机站如何跳转PC站呢?下面运营狗分享一段简单的跳转代码。<script type="text/javascript">
// 跳转PC页面
if (!navigator.userAgent.match(/AppleWebKit.*Mobile.*/)) {
location.href = 'http://www.pc.com';
}
</script>