Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从博主重定向到我的移动网站?
我尝试在其中添加一些代码,但它不起作用。
http://www.designyourway.net/blog/resources/detecting-and-redirecting-mobile-users/
我认为您想使用以下方式检测移动设备Javascript
Javascript
添加:
<script> if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { window.location.href="http://My-Mobile-Site.com"; } </script>
在您的<head>标签之间,现在每当有人使用移动设备访问您的博客时,他们都会重定向到您的移动网站
<head>