treehouse : what would you like to learn today?
Web Design Web Development iOS Development

audio.onended isn't working in Chrome

  • I do a lot of studying and testing with Html5, in particular the "audio" and "video" spec. My question is this

    Why doesn't audio.onended seem to fire in Chrome. It works fine in Firefox and Opera.

    Entire function
    Code:

    var audio = document.getElementsByTagName('audio')[0];
    audio.onended = function(e) {
    document.location.href = "002.htm";
    }

    Example page
    http://www.code-pigs.com/Html 5 Audio/For Anton.htm

    I've done a lot of research and can't seem to find the answer

    While I consider Chrome as one of the best browsers, it seems to be quite "buggy" from a developers standpoint, to include CSS issues

    Thx