if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){ //判斷手機訪問跳轉到手機站 window.location.href='n135/index.html'; }else if(/iPad/i.test(navigator.userAgent)){ //判斷iPad訪問跳轉到iPad頁面 window.location.href='n135/index.html'; }