闪光检测脚本

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了闪光检测脚本相关的知识,希望对你有一定的参考价值。

  1. Flash Detect: Flash Page or No-Flash Page
  2.  
  3. <SCRIPT LANGUAGE=javascript1.1>
  4. <!--
  5. var MM_contentVersion = 6;
  6. var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
  7. if ( plugin ) {
  8. var words = navigator.plugins["Shockwave Flash"].description.split(" ");
  9. for (var i = 0; i < words.length; ++i)
  10. {
  11. if (isNaN(parseInt(words[i])))
  12. continue;
  13. var MM_PluginVersion = words[i];
  14. }
  15. var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
  16. }
  17. else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
  18. && (navigator.appVersion.indexOf("Win") != -1)) {
  19. document.write('<SCR' + 'IPT LANGUAGE=VBScript> '); //FS hide this from IE4.5 Mac by splitting the tag
  20. document.write('on error resume next ');
  21. document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion))) ');
  22. document.write('</SCR' + 'IPT> ');
  23. }
  24. if ( MM_FlashCanPlay ) {
  25. window.location.replace("http://www.kirupa.com/flash.htm");
  26. } else{
  27. window.location.replace("http://www.kirupa.com/noflash.htm");
  28. }
  29. //-->
  30.  
  31. </SCRIPT>
  32.  
  33.  
  34. Flash Detect: Image or Animation
  35.  
  36. <SCRIPT LANGUAGE=JavaScript1.1>
  37. <!--
  38. var MM_contentVersion = 6;
  39. var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
  40. if ( plugin ) {
  41. var words = navigator.plugins["Shockwave Flash"].description.split(" ");
  42. for (var i = 0; i < words.length; ++i)
  43. {
  44. if (isNaN(parseInt(words[i])))
  45. continue;
  46. var MM_PluginVersion = words[i];
  47. }
  48. var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
  49. }
  50. else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
  51. && (navigator.appVersion.indexOf("Win") != -1)) {
  52. document.write('<SCR' + 'IPT LANGUAGE=VBScript> '); //FS hide this from IE4.5 Mac by splitting the tag
  53. document.write('on error resume next ');
  54. document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion))) ');
  55. document.write('</SCR' + 'IPT> ');
  56. }
  57. if ( MM_FlashCanPlay ) {
  58. document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
  59. document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
  60. document.write(' ID="script" WIDTH="300" HEIGHT="200" ALIGN="">');
  61. document.write(' <PARAM NAME=movie VALUE="script.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> ');
  62. document.write(' <EMBED src="script.swf" quality=high bgcolor=#FFFFFF ');
  63. document.write(' swLiveConnect=FALSE WIDTH="300" HEIGHT="200" NAME="script" ALIGN=""');
  64. document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
  65. document.write(' </EMBED>');
  66. document.write(' </OBJECT>');
  67. } else{
  68. document.write('<IMG SRC="script.gif" WIDTH="300" HEIGHT="200" usemap="#script" BORDER=0>');
  69. }
  70. //-->
  71. </SCRIPT><NOSCRIPT><IMG SRC="script.gif" WIDTH="300" HEIGHT="200" usemap="#script" BORDER=0></NOSCRIPT>

以上是关于闪光检测脚本的主要内容,如果未能解决你的问题,请参考以下文章

检测闪光灯是不是已经打开

ActionScript 3 闪光灯焦点检测

闪光焦点检测

检测与 Retina Flash 相关的相机闪光灯

天龙八部怎么检测脚本

Linux脚本实战之检测网卡流量