nicholas@2384: // Script to load the relevant JS files if the system supports it nicholas@2683: /*globals window, document */ nicholas@2538: window.onload = function () { nicholas@2384: // First check if the Web Audio API is supported nicholas@2683: if (window.AudioContext === undefined && window.webkitAudioContext === undefined) { nicholas@2384: // Display unsuported error message nicholas@2384: var body = document.getElementsByTagName("body")[0]; nicholas@2384: body.innerHTML = "

Sorry! Your browser is not supported :(

Your browser does not support the HTML5 Web Audio API. Please use one of the following supported browsers instead.

"; nicholas@2384: var table = document.createElement("table"); nicholas@2384: table.border = "0"; nicholas@2384: table.innerHTML = "Chromev10 or newer"; nicholas@2384: table.innerHTML += "Firefoxv25 or newerSafari (OSX) v6 or newer, OSX only"; nicholas@2384: table.innerHTML += "Safari (iOS)iOS 6.1 or newer"; nicholas@2384: table.innerHTML += "Edge12 or newer"; nicholas@2384: body.appendChild(table); nicholas@2384: } else { nicholas@2384: var head = document.getElementsByTagName("head")[0]; nicholas@2384: var src_list = ['js/specification.js', 'js/core.js', 'js/loudness.js', 'js/xmllint.js', 'js/WAVE.js']; nicholas@2538: for (var i = 0; i < src_list.length; i++) { nicholas@2384: var src = src_list[i]; nicholas@2384: var script = document.createElement("script"); nicholas@2384: script.type = "text/javascript"; nicholas@2384: script.async = false; nicholas@2384: script.defer = true; nicholas@2384: script.src = src; nicholas@2384: head.appendChild(script); nicholas@2384: } nicholas@2384: } nicholas@2683: };