我正在开发移动版本的网站。我正在使用此Javascript检测并重定向用户:Android模拟器浏览器检测
if((navigator.userAgent.match(/iPhone/i)) ||
(navigator.userAgent.match(/Android/i)) ||
(navigator.userAgent.match(/iPod/i)))
{
window.location = "http://sitename.com/m/";
}
适用于iPhone和iPod,但Android没有成功。我在Eclipse中使用Android模拟器。我没有一个Android小工具来实际测试它。
我做错了什么?任何人有同样的问题?
非常感谢,先生。 :) – Vitor 2010-03-08 01:39:27
这也帮助我了。为了清楚起见,Android似乎不支持windows.location。 location.replace()工作正常。 – Symmetric 2011-01-31 08:53:06