//獲得客戶端操作系統(tǒng)來(lái)指定不同版本的msi包下載
<script type="text/javascript">
function GetOSInfo(){
var _pf = navigator.platform;
var appVer = navigator.userAgent;
if(_pf == "Win32" || _pf == "Windows")
{
if(appVer.indexOf("WOW64")>-1){
_bit = "64位";
}else{
_bit = "32位";
}
if(appVer.indexOf("Windows NT 6.1") > -1 || appVer.indexOf("Windows 7") > -1) {
if(_bit=='32位' || appVer.indexOf("Windows 7") > -1){
location.href="client/win7_32_client.msi";
//return 'Windows_7 '+_bit;
}else if(_bit=='64位' || appVer.indexOf("Windows 7") > -1){
location.href="client/win7_64_client.msi";
//return "Unknow";
}else{
return "Unknow";
}
}else if(appVer.indexOf("Windows NT 5.1") > -1 || appVer.indexOf("Windows XP") > -1){
if(_bit=='32位' || appVer.indexOf("Windows XP") > -1){
location.href="client/xp_32_client.msi";
//return 'Windows_XP '+_bit;
}else if(_bit=='64位' || appVer.indexOf("Windows XP") > -1){
location.href="client/xp_64_client.msi";
//return "Unknow";
}else{
return "Unknow";
}
}else if(_pf == "Mac68K" || _pf == "MacPPC" || _pf == "Macintosh")
{
return "Mac";
}else if(_pf == "X11")
{
return "Unix";
}else if(String(_pf).indexOf("Linux") > -1)
{
return "Linux";
}else
{
return "Unknow";
}
}
}
調(diào)用:<a class="pc-c-win7"? href="javascript:;" onclick="GetOSInfo()" />