Voici un javascript bien pratique pour détecter si le visiteur possède le plugin flash.
<html> <head> <title>Test</title> <SCRIPT LANGUAGE="JavaScript"> var isFlash = false; // Pour tous navigateurs sauf IE if (navigator.plugins && navigator.plugins.length > 0) { var pluginsArrayLength = navigator.plugins.length; // Pour chaque plugin du navigateur... for (pluginsArrayCounter=0; pluginsArrayCounter < pluginsArrayLength; pluginsArrayCounter++ ) { if(navigator.plugins[pluginsArrayCounter].name.indexOf("Shockwave Flash") >= 0){ // Si 1 des plugins contient Shockwave Flash isFlash = true; // Alors flash player OK break; } } } </SCRIPT> <SCRIPT LANGUAGE="VBScript"> // Detection pour Internet Explorer On error resume next isFlash = NOT IsNull(CreateObject("ShockwaveFlash.ShockwaveFlash")) </SCRIPT> </head> <body> <!-- A placer ou vous avez votre anime flash --> <SCRIPT LANGUAGE="JavaScript"> if(isFlash){ document.write("Flash ok. <br>Votre anime flash"); // Placez votre anime }else{ document.write("Flash bad votre image de remplacement"); // Placez votre image de remplacement } </SCRIPT> <!-- ------------------------------------ --> </body> </html>
Discussion