html網頁判斷手機還是電腦登陸進入

<script type="text/javascript">
try{
    if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
        window.location.href="mindex.html";
    }else{
        window.location.href="cindex.html";
    }
}catch(e){}
</script>


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章