Not an expert, a total beginner trying to learn... I'm using a very basic html5 audio code, which I'm putting inside an iWeb 'widget'. It works fine in terms of playing the audio, and I understand about expanding the browser fall back and other options later. But - what I want it to do is make the window automatically go to a new web page when the track has finished. So there is some script afterwards taken from a website that claims to do this... This is the code I am using:
<audio controls autoplay>
<source src="AUDIO FILE LOCATION.mp3" type="audio/mp3">
<object data="mediaplayer.swf?audio=AUDIO FILE LOCATION.mp3">
<param name="movie" value="mediaplayer.swf?audio=AUDIO FILE LOCATION.mp3">
</object>
</audio>
<script>
var audio = document.getElementsByTagName('audio')[0];
audio.onended = function(e) {window.location='http://www.google.com';}
</script>
When I view this in the browser, the song ends and Firefox and Safari both show "connecting to google.com, spin for a couple of seconds and then nothing happens. Page stays where it is and audio player disappears. The onended event seems to be triggering google, but google is then not loading properly. I'm stuck. Can anyone help?