如何识别当用户使用某些旧手机(而非智能手机和iPhone)来到网站时。我使用jQuery-Mobile和Joomla 1.7。移动侦测并支持旧设备
我使用这个脚本:
<script type="text/javascript">// <![CDATA[
var mobile = (/acer|alcatel|audiovox|avantgo|blazer|cdm|digital paths|elaine|epoc|handspring|iemobile|kyocera|lg|midp|mmp|mobile|motorola|nec|o2|openwave|opera mini|operamini|opwv|palm|panasonic|pda|phone|playstation portable|pocket|psp|qci|sagem|sanyo|sec|sendo|sharp|smartphone|symbian|telit|tsm|up-browser|up.browser|up.link|vodafone|wap|windows ce|xiino|ericsson|sonyericsson|iphone|ipod|android|blackberry|samsung|nokia|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));
if (mobile) {
document.location = "http://mysite,com/mobile";
}
// ]]></script>
网站与HTC,iPhone,诺基亚等效果很好。 我的朋友测试了一些爱立信(不知道模型),但网站不会工作。它只显示PC站点,不显示移动设备。
不知道支持。 – user869470
为什么不在第一页的PHP中检查浏览器或操作系统并将用户重定向到您的移动网站? – Jazzschmidt