Jim Ley <ji*@jibbering.com> wrote/schrieb:
Great, so use your script, detect flash, if it's found replace the
fallback image in the page with the flash, no need to do anything in
the situation where flash isn't detected, you just leave the document
as is, same as when script is disabled.
Resolution found!
Problem:
JS-Browser detection works fine if any version of flash plugin
(vers.2-7) is installed. If there is _NO_ flash plugin installed, SCRIPT
and NOSCRIPT content will be executed by Opera, pictures for example
will be shown twice.
This behavior is according to W3C because Opera does not know the
'SCRIPT LANGUAGE=VBScript' and will trade it as a script error with
execution of the NOSCRIPT content.
http://www.w3.org/TR/1998/REC-html40....html#h-18.3.1
Resolution:
This behaviour can be solved simply by adding 'window.opera &&' to this
line of the detection script:
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
&& (navigator.appVersion.indexOf("Win") != -1)) {
Better version:
else if (!window.opera && navigator.userAgent &&
navigator.userAgent.indexOf("MSIE")>=0 &&
(navigator.appVersion.indexOf("Win") != -1)) {
Browser detection in Opera is difficult because of spoofing, but IMHO
'Opera' will always be shown.....
The whole flash detection script works now including display of alternative
content
for 'too low flash version',
for 'no flash plugin detected/installed' and
for 'javascript disabled'
in NS4.7+, IE 5+, Opera5+, Moz1+, Konqueror3+ on Win32/Linux.
[Somebody surfing with MAC???]
Whole detection script:
<!-- Start Flash -->
<script type="text/javascript">
<!--
var contentVersion = 5;
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 PluginVersion = words[i];
}
var FlashCanPlay = PluginVersion >= contentVersion;
}
else if (!window.opera && 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('FlashCanPlay = (
IsObject(CreateObject("ShockwaveFlash.ShockwaveFla sh." &
contentVersion)))\n');
document.write('</SCR' + 'IPT\> \n');
}
if ( FlashCanPlay ) {
document.write('<OBJECT
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflas
h.cab#version=6,0,0,0" ID="schloss_gr" WIDTH="365" HEIGHT="265">');
document.write('<PARAM NAME="movie" VALUE="schloss_gr.swf"><PARAM
NAME="quality" VALUE="high"><PARAM NAME="scale" VALUE="exactfit"><PARAM
NAME="bgcolor" VALUE="#E2E2E2">');
document.write('<EMBED src="schloss_gr.swf" quality="high"
scale="exactfit" bgcolor="#E2E2E2" swLiveConnect=FALSE WIDTH="365"
HEIGHT="265" NAME="schloss_gr" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
document.write('</EMBED>');
document.write('</OBJECT>');
} else{
document.write('<a href="../start/index.html" target="_parent"><img
src="../index/schloss_gr.jpg" width="365" height="245" border="0"
alt="Praxis"></a>');}
//--></script>
<noscript>
<a href="../start/index.html" target="_parent"><img
src="../index/schloss_gr.jpg" width="365" height="245" border="0"
alt="Praxis"></a>
</noscript>
<!-- End Flash -->
--
Best regards/ MfG,
Gustav Medler
pm.gustav.medler (at) gmx.net
*Mail reply will not be read,
*please use address above!