V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
getcww
V2EX  ›  问与答

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

  •  
  •   getcww · 2015-02-26 18:04:00 +08:00 · 2244 次点击
    这是一个创建于 3352 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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);
    }
    3 条回复    2015-02-26 18:28:26 +08:00
    loading
        1
    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
        2
    66beta  
       2015-02-26 18:22:00 +08:00
    getcww
        3
    getcww  
    OP
       2015-02-26 18:28:26 +08:00
    谢谢两位楼主~
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1033 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 23:39 · PVG 07:39 · LAX 16:39 · JFK 19:39
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.