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.
我想采用一种方法将我的固定宽度网站转换为手持设备友好型网站。任何人都可以建议哪种方法是最好的。考虑到它不应该影响网站的加载时间。我相信响应式网页设计应该可以工作,但我从研究中发现响应式网页设计中使用的响应式图像有时会影响网页加载时间。
我认为检测移动浏览器用户代理字符串(服务器端)并相应地显示内容是明智的。
如果您使用 PHP 进行构建,请查看这个很棒的脚本。
用法是这样的:
if($isMobile){ header('Location: http://m.youdomain.com/' . urlencode($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])); exit(); }
另请查看切换器