<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