JavaScript 플래시 설치 여부 확인

Jmnote (토론 | 기여)님의 2015년 1월 29일 (목) 18:33 판 (→‎예시 2)
자바스크립트 플래시 설치 여부 확인
is_flash_installed

1 예시

<script>
var is_flash_installed = false;
try {
  if(new ActiveXObject('ShockwaveFlash.ShockwaveFlash')) is_flash_installed=true;
}catch(e){
  if(navigator.mimeTypes['application/x-shockwave-flash'] != undefined) is_flash_installed=true;
}
document.write( is_flash_installed );
</script>

2 예시 2

<script>
function is_flash_installed() {
	try { if(new ActiveXObject('ShockwaveFlash.ShockwaveFlash')) return true; }
	catch(e){ if(navigator.mimeTypes['application/x-shockwave-flash'] != undefined) return true; } 
	return flase;
}
document.write( is_flash_installed() );
</script>
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}