Okay so I have an html5 audio player that i built with jquery however i need to get the track url from the variable in the url with a get request so that it can then be used in the jquery script. Not sure how to do it. I have the jquery in a seperate file to the markup for easy embedding for users. The url will look like www.mysite.co.uk/player/player.html?url=testing123.mp3.
I can easily get the variable for use in the markup to show the name of the artist etc with PHP but not sure how to do it for the jquery script. I have had a look around but no luck.
Heres the relevent jquery
song = new Audio('THIS IS WHERE THE GET VARIABLE NEEDS TO BE');
I shouldnt think anymore code is needed but if it is just ask.
head
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
<?php $url = $_GET['url']; ?>
<script> // Before jQuery
var song = new Audio(`<?php echo($url); ?>`);
</script>`
<script type="text/javascript" src="http://newbornsounds.co.uk/player/src/js/js.js"></script>
<script type="text/javascript" src="http://newbornsounds.co.uk/player/src/js/html5slider.js"></script>
Heres the relevent jqueryYMMD. :)