如何判断 ie 是否支持 html5 的 audio 元素?如果支持执行 A.JS 代码,如果不支持则执行 B.JS

2015-02-26 18:04:00 +08:00
 getcww
var audio = document.getElementById("audio");
audio.loop = false;
window.onload = function(){//页面加载完毕后调用
var ass = document.getElementById('audio').duration;//如果当前时常为NaN赋值
if(this.isNaN(ass)){
var ids = '[dance:id]'-2;
//this.self.location='127.0.0.1/ceshi/index.php/dance/play/id/'+ids;
}else{
var ids = '[dance:id]'-1;
};
audio.addEventListener('ended', function () {

this.self.location='127.0.0.1/ceshi/index.php/dance/play/id/'+ids;
}, false);
}
2282 次点击
所在节点    问与答
3 条回复
loading
2015-02-26 18:08:32 +08:00
http://stackoverflow.com/questions/11681856/html5-audio-tag-flash-fall-back

我是用 Google 关键字"html5 audio fallback"找到的,也许你不知道要用"fallback"这个关键字。
希望能帮到您。
66beta
2015-02-26 18:22:00 +08:00
getcww
2015-02-26 18:28:26 +08:00
谢谢两位楼主~

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/172995

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX