I have a page. It has upload mp3 and an audio player. You upload and javascript uploads mp3 file, reloads page, and the audo player is now loaded with the mp3 file.
FYI. I call a php function to load up the mp3 file.
all is working fine.
EXCEPT, NOW I have issue where I ONLY need to refresh or reload the audio player or reload the mp3 file, which is returned from my php function.
I have tried this: $('#mp3Player').html(document.URL + ' #mp3Player');
and tried: .load and .replaceWith
however, all are not correct, one just loads another mp3, or the whole page, or just adds text inside the player, etc.
HOW do I do the exact same thing as a page reload, BUT ONLY for the audio player?
thanks!
NOTE: the javascript itself doesn't know or have the new mp3 file. it only knows that a new mp3 has been uploaded, and after it's done... it refreshes the page. the PHP code grabs the new mp3 file.
again, a page refresh/reload works perfect. BUT I have need to ONLY refresh the div or the audio player, NOT the whole page.