2011-01-05 64 views
2

http://www.javascriptkit.com/script/script2/plugindetect.shtml從JavaScript檢測Flash插件

我想從上面url.But的代碼似乎並不爲IE瀏覽器檢測flash插件使用javascript我在做什麼錯在這裏

我只需要看flash插件是否在瀏覽器intsalled或不

if (pluginlist.indexOf("Flash")== -1) 
{ 
    alert("You do not have flash player plugin installed.Please install flash player"); 
    window.location = "/home"; 
} 
+0

possible dupe http://stackoverflow.com/questions/998245/how-can-i-detect-if-flash-is-installed-and-if-not-display-a-hidden-div-that-info – 2011-01-05 09:30:23

回答

0

我試圖用你發佈的鏈接相同的插件。

我用下面的代碼,它在我的IE運行良好太..

<html> 
    <head> 

     <script language="javascript" type="text/javascript" src="plugins.js" ></script> 

     <script language="javascript" type="text/javascript"> 
      if (pluginlist.indexOf("Flash")== -1) 
      { 
       alert("You do not have flash player plugin installed.Please install flash player"); 
       window.location = "/home"; 
      } 
      else{ 
       alert("You have it installed"); 
      } 
     </script> 
    </head> 

    <body> 


    </body> 
</html> 

我覺得這個問題似乎與寫標籤的方式。 你是否完全像我一樣?或者你可以去我的HTML。

謝謝!

侯賽因

1

我也試過同樣的flash插件,但在不同環節的教程。我嘗試了以下的JavaScript代碼:

<script type="text/javascript" src="swfobject.js"></script> 

<div id="flashcontent"> 
    This text is replaced by the Flash movie. 
</div> 

<script type="text/javascript"> 
    var so = 
     new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699"); 
    so.write("flashcontent"); 
</script> 

準備一個HTML元素,將保存我們的Flash電影。放置在'holder'元素中的內容將被Flash內容替換,因此安裝Flash插件的用戶將永遠不會看到此元素中的內容。該功能還可讓搜索引擎編制替代內容的索引。

var so = new SWFObject(swf, id, width, height, version, background-color 
     [, quality, xiRedirectUrl, redirectUrl, detectKey]); 

並獲得成功。你也可以試試這段代碼,告訴我發生了什麼。我希望你會獲得成功。祝一切順利。