Use JavaScript to detect if the Flash plugin is installed (For IE)
Function check_shockwaveflash () {
VAR SWF, VER0 = 2, Version, INSTALLED, E;
Version = VER0;
While (1) {
Try {
Version = 1;
//Shockwaveflash.shockwaveflash.2 failed
SWF = New ActiveXObject ('ShockWaveflash.shockwaveflash.' Version);
} catCH (e) {
Version- = 1;
Break;
}
}
this.installed = (Version! = VER0)
THIS.VERSION = Version;
}
Var x = new check_shockwaveflash ()
Document.write ("
shockwaveflash plugin detection")
Document.write ("
installed:" x.installed)
IF (x.installed) {
Document.write ("Version:" x.version " font>")
}
// Native test results: ActiveXObject ('ShockWaveFlash.shockwaveflash.2') failed, but other versions in 1-7 can
// SWF = New ActiveXObject ('ShockWaveFlash.shockwaveflash.' 1);
// ->
Script>
Use Flash to detect
If the user doesn't even execute the SCRPIT, you can only use this. This is also the method of mm itself.
Be a test html, put a swf inside, there is only one getURL ("You really page")
At the same time,
If SWF is not taken to the real page within 10 seconds, the detected HTML will bring you a page that is not installed.
Scripts generated with Dreamweaver's behavioral panel:
Function mm_checkplugin (Plgin, Turl, Alturl, Autogo) {//v4.0
VAR OK = false; Document.mm_ReturnValue = FALSE;
With (Navigator) IF ('Microsoft') == - 1 || (Plugins && Plugins.length) {OK = (Plugins && Plugins [PLGIN]);
} else if (appversion.indexof ('3.1') == - 1) {// not netscape or win3.1
IF (PLGIN.Indexof ("Flash")! = - 1 && window.mm_flash! = null) OK = window.mm_flash;
Else IF ("Director")! = - 1 && window.mm_dir! = null) OK = window.mm_dir;
Else ok = autogo;
IF (! ok) Turl = AltURL; if (theurl) window.location = theurl;
}
// ->
script>
hEAD>