summaryrefslogtreecommitdiffstats
path: root/dom/browser-element/mochitest/file_browserElement_ActiveStateChange.html
blob: 5228d67bf79bdc734562c475b8623adbc59418e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE HTML>
<html>
<body>
<script type="application/javascript;version=1.7">
var audio = new Audio();
audio.src = "audio.ogg";
audio.loop = true;

function runCommands()
{
  switch(location.hash) {
    case '#play':
      audio.play();
      break;
    case '#pause':
      audio.pause();
      break;
    default :
      alert("Undefined command!");
  }
}
window.addEventListener('hashchange', runCommands);
</script>
</body>
</html>