javascript檢測FLASH PLAYER代碼

來源:互聯網
上載者:User

<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>

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.