使用navigator.userAgent来判断浏览器类型 if(navigator.userAgent.indexOf("iPad")!=-1||navigator.userAgent.indexOf("iPhone")!=-1){ window.location.href=""; }