欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

借助JavaScript腳本判斷瀏覽器Flash Player信息的方法

 更新時(shí)間:2014年07月09日 17:45:15   投稿:whsnow  
做了一個(gè)小的Demo,在測(cè)試時(shí)發(fā)現(xiàn)經(jīng)常報(bào)錯(cuò),對(duì)此總結(jié)了一下借助JavaScript腳本判斷瀏覽器Flash Player信息的方法,需要的朋友可以參考下

今天研究了點(diǎn)Flex技術(shù),做了一個(gè)小的Demo,在測(cè)試時(shí)發(fā)現(xiàn)經(jīng)常報(bào)錯(cuò),網(wǎng)上一查發(fā)現(xiàn)是瀏覽器Flash Player版本較低造成(需要10及其以上的版本)的,對(duì)此總結(jié)了一下借助JavaScript腳本判斷瀏覽器Flash Player信息的方法:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<html> 
<head> 
<title>JavaScript判斷瀏覽器Flash Player信息</title> 
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> 
<script type="text/javascript"> 
function checkFlashPlayer(){ 
var hasFlashPlayer=0; //判斷是否安裝了Flash Player 
var flashPlayerVersion=0; //Flash Player版本 
if(document.all){ 
var shockWaveFlash = new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); 
if(shockWaveFlash) { 
hasFlashPlayer=1; 
flashPlayerVersion=parseInt(shockWaveFlash.GetVariable("$version").split(" ")[1].split(",")[0]); 
} 
}else if (navigator.plugins && navigator.plugins.length > 0){ 
var shockWaveFlash=navigator.plugins["Shockwave Flash"]; 
if (shockWaveFlash){ 
hasFlashPlayer=1; 
var descriptionInfo = shockWaveFlash.description.split(" "); 
for (var i = 0; i < descriptionInfo.length; ++i){ 
if (isNaN(parseInt(descriptionInfo[i]))){ 
continue; 
} 
flashPlayerVersion = parseInt(descriptionInfo[i]); 
} 
} 
} 
return {hasFlashPlayer:hasFlashPlayer, flashPlayerVersion:flashPlayerVersion}; 
} 

if(checkFlashPlayer().hasFlashPlayer){ 
if(checkFlashPlayer().flashPlayerVersion <= 10){ 
if(confirm("您的Flash Player版本過(guò)低,立即升級(jí)Flash Player版本?")){ 
window.location. rel="external nofollow" rel="external nofollow" ; 
} 
}else{ 
alert("您安裝了Flash Player,當(dāng)前Flash Player版本號(hào)為:"+checkFlashPlayer().flashPlayerVersion+"。"); 
} 
}else{ 
if(confirm("您沒(méi)有安裝Flash Player,立即安裝?")){ 
window.location. rel="external nofollow" rel="external nofollow" ; 
} 
} 
</script> 
</head> 

<body> 
</body> 
</html>

相關(guān)文章

最新評(píng)論