Mendeteksi browser visitor jika tidak ada flash, jalankan gif menggunakan javascript.
How to detect browser no flash and we give alternate with animation file gif.
Pada contoh code, kita asumsikan file “contoh.swf” dan “contoh.gif” sebagai pengganti jika browser visitor tidak ada flash player nya.
<!-- begin the OBJECT tag, which will be understood by ActiveX-capable browsers -->
<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://active.macromedia.com/flash/cabs/swflash.cab#version=3,0,0,11" width="165" height="164" name="sw" ID="sw">
<param name="movie" value="contoh.swf" />
<param name="quality" value="high">
<param name="Loop" value="true">
<param name="play" value="true">
<param name="wmode" value="opaque">
<param name="allowScriptAccess" value="sameDomain" />
<param name="bgcolor" value="#000000" />
<!-- begin the JavaScript -->
<script type="text/javascript">
//If this browser understands the mimeTypes property and recognizes the MIME Type //"application/x-shockwave-flash"...
if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]){
//...write out the following <EMBED> tag into the document.
document.write('<embed src="contoh.swf" quality="high" bgcolor="#000000" width="165" height="164" name="contoh" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" LOOP="true" PLAY="true" wmode="opaque" />');
} else { //Otherwise,...
//...write out the following <img> tag into the document. The image need
//not be the same size as the Flash Player movie, but it may help you lay out the
//page if you can predict the size of the object reliably.
document.write('<img src="contoh.gif" width="220" height="110" title="Contoh">');
}
</script>
<!-- Close the OBJECT tag. -->
</OBJECT>
Continue reading...

Loading ...
Popularity: 624 views