您的位置:首页 > Web前端 > JavaScript

javascript检测FLASH PLAYER代码

2006-01-17 12:54 337 查看
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 6</title><SCRIPT LANGUAGE=JavaScript>
<!--
//可在此处修改FLASH的版本号码
var MM_contentVersion = 6;

var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ?
navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

if ( plugin ) {
var words = navigator.plugins["Shockwave Flash"].description.split(" ");
for (var i = 0; i < words.length; ++i){
if (isNaN(parseInt(words[i])))
continue;
var MM_PluginVersion = words[i];
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if( navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 &&
(navigator.appVersion.indexOf("Win") != -1) ) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
document.write('</SCR' + 'IPT\> \n');
}

if ( MM_FlashCanPlay )
{
//window.alert("检测到FLASH");
setInterval('document.getElementById("demo").cols="1024,*"')
}
else
{
//window.alert("未检测到FLASH");
window.open("www.sft800.com");
//未检测到FLASH PLAYER后在当前页面转向FLASH PLAYER安装向导界面,

//setInterval('document.getElementById("demo").style.display="block"')
//setInterval('document.getElementById("demo1").style.display="none"')
//控制div层是否显示, block显示,none不显示

setInterval('document.getElementById("demo").cols="0,*"')
//控制FRAME窗体的载入位置.

}
</SCRIPT>
</head>

<body>
<!--通过定义ID属性控制div层的显示-->
<div id="demo" style="position:absolute;left:450px;top:29px; height:96px; width:98px">
<a title="说明页面" href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=S_Chinese&P5_Language=S_Chinese">
<img border="0" src="ghost.jpg" width="96" height="96"></a></div>
<div id="demo1" style="position: absolute; width: 100px; height: 91px; z-index: 1; left: 449px; top: 29px" id="layer1">
<a title="主页面" href="11">
<img border="0" src="20050830233847537.jpg" width="96" height="96"></a></div>

<!--通过定义ID属性控制frame的显示-->
<frameset id="demo" rows="*">

<frameset id="demo" cols="430,*">

<frame name="a" src="d8zx.html" marginwidth="0" marginheight="0" scrolling="no">
<frame name="b" src="UntitledFrame-5.html" target="_self">
<noframes>
<body>

<p>此网页使用了框架,但您的浏览器不支持框架。</p>
</body>
</noframes>
</frameset>

</frameset>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: