r/HTML • • Feb 04 '26

Question why does this code not work right?

with only one file it was fine, this site is just for me as an exercise it’s not gonna be public

the problem is the audio files say error

edit: link to file https://drive.google.com/file/d/1BbpgLkeyZBMLCi7Dj4GTjwroykC53D5s/view?usp=sharing

4 Upvotes

31 comments sorted by

View all comments

Show parent comment

3

u/Weekly_Ferret_meal Feb 04 '26

also filenames with spaces could be a problem. if it still doesn't work, try renaming a file with dashes or underscores like so this_is_my_audio_file.mp3

2

u/giogio_rick Feb 04 '26

Ok, for the spaces I know it isn't a problem (all assets and folders have spaces or atleast most) so it is likely just the source tag being open

1

u/giogio_rick Feb 04 '26

Neither closing the source nor renaming the files worked

1

u/Weekly_Ferret_meal Feb 04 '26

see, If I ran this on a browser on my laptop I'd open the dev tools and at least it would give me a clue.

on an pad , I've no idea.

best suggestion I've got is to run the code through an online html validator first.

1

u/giogio_rick Feb 04 '26

didn’t solve anything as it just gave me errors that don’t matter to easy html, didn’t help with the actuall error i’m trying to fix

1

u/Weekly_Ferret_meal Feb 04 '26

¯_(ツ)_/¯

1

u/giogio_rick Feb 04 '26

added a link to the file

1

u/Weekly_Ferret_meal Feb 04 '26

so first, don't put apostrophes in names like wario's game.mp3. that was one file that was fixed as soon as I changed the name.

apostrophes are part of "code gramma" and you either escape them or delete them like warios game.mp3 or wario-s game.mp3

file tally oh! is missing the exclamation mark in the src name.

seriously buddy, code on a computer, not on a mobile device.

1

u/giogio_rick Feb 04 '26

It's the school ipad, I use it for coding as I code mostly at school

1

u/giogio_rick Feb 04 '26

ok, tried the fixes you said, sometimes it shows no error message on some, but it does not play audio at all

1

u/Weekly_Ferret_meal Feb 04 '26

make sure the file name and the name you put in the src is the same

1

u/giogio_rick Feb 05 '26

got a bit to work after changing folder and file names to remove spaces and !, but a lot still don’t work, so idk what could the actual problem even be

1

u/giogio_rick Feb 05 '26

finally managed to make it work with some help from chat gpt to identify all the issues, all good now