熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> JSP教程 >> 正文

js判斷是手機訪問還是電腦訪問,進行自動跳轉

2013-11-15 12:07:51  來源: JSP教程 

  <script type="text/javascript">

  <! //平台設備和操作系統 var system ={ win : false mac : false xll : false }; //檢測平台 var p = navigatorplatform; alert(p); systemwin = pindexOf("Win") == ; systemmac = pindexOf("Mac") == ; systemx = (p == "X") || (pindexOf("Linux") == ); //跳轉語句 if(systemwin||systemmac||systemxll){//轉向後台登陸頁面 windowlocationhref="loginjsp"; }else{ windowlocationhref="wapLojinjsp"; } > </script>


From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20364.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.