<script language="javascript"> window.onload = function () { alert("1"); var u = navigator.userAgent; if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {//安卓手機 alert("安卓手機"); // window.location.href = "mobile/index.html"; } else if (u.indexOf('iPhone') > -1) {//蘋果手機 // window.location.href = "mobile/index.html"; alert("蘋果手機"); } else if (u.indexOf('Windows Phone') > -1) {//winphone手機 alert("winphone手機"); // window.location.href = "mobile/index.html"; } } </script>