coasterguy26
New Member
I am writing a Chrome Web Application in which I am dynamically creating <audio> tags through Javascript. Javascript is pulling the names from an object literal. When I run the files locally through Chrome, it works just fine. Once I load them onto a server, they stop working. The dynamic images work fine, so I'm curious as to why the audio does not. What could possibly be wrong? Here is my javascript code:\[code\]var IG = { 0: { 'sound': 'chair.ogg', 'link': 'images/chair.png', 'name': 'Chair'}};var audio1 = '<audio controls><source src="http://stackoverflow.com/questions/15596633/audio"';var audio2 = '" type="audio/ogg">Your browser does not support the audio element. Please upgrade your browser.</audio>';document.getElementById('quiz').innerHTML += audio1 + IG[order].sound + audio2;\[/code\]The reason why I var'd audio1 and audio2 is that I have to create dozens of audio files (IG is actually quite big) and I wanted to save myself the hassle of re-writing that part.