Hello! Im trying to make a webpage thing where you can upload a mp3 file and have it play.
but it doesnt work. I have been trying to get it work for about 2 days now but i just cant figure it out. Does anyone see why this doesnt work? Its for html
Hello! Im trying to make a webpage thing where you can upload a mp3 file and have it play.
Hi @BoiledFlea, can you try getting rid of the source
tag and replace $("#src")...
with $("#audio")...
?
Hi @BoiledFlea
The problem seems to be that the add event listener line can’t run until the document is fully loaded. Since you have jquery, you can do this:
$(document).ready(function(){
})
and put the
document.getElementById("upload").addEventListener("change", handleFiles, false);
line in that function!
Hope this helps
If it did, press the ‘Solution’ button. Looks like @Pufferfish101007’s solution isn’t necessary. Correct me if I am wrong.
Eddie
I think that is correct I was even doing this earlier and I missed it
Another option is to place the script tag right at the bottom of the page.
That did the trick, thanks!
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.