現在、HTML5はより人気が高まっているようです。互換性を検討するために、一部のフロントエンドの専門家は、クライアントブラウザを判断するためにWebページにコードを追加し、ユーザーのブラウザがHTML5をサポートしているかどうかを知ります。自分で使用したい2つの方法があります。
方法1、
<script>関数CHECKHHTML5(){if(typeof(worker)!== "undefined"){alert( "support html5"); } else {alert( "html5"をサポートしないでください "); }} </script>方法2、
<canvas id = "canvas"> </canvas> <script> if(!document.getElementbyId( "canvas")。getContext){alert( "html5 not supported);} else {alert(" html5 ");} </scrip>方法3:
<script> window.onload = function(){if(!window.applicationcache){alert( "あなたのブラウザーはhtml5!"); }} </script>より良い方法があれば、私に連絡してください!ありがとう