<html>
<body>
<p>我的浏览器可以播放 OGG 文件吗?
<span>
<button onclick="supportType(event,'audio/ogg','vorbis')" type="button">测试</button>
</span>
</p>
<script>
function supportType(e,vidType,codType) {
var x = document.createElement("AUDIO");
isSupp = x.canPlayType(vidType+';codecs="'+codType+'"');
if (isSupp == "") {
isSupp = "No";
}
e.target.parentNode.innerHTML = "回答:" + isSupp;
}
</script>
</body>
</html>