I have a jQuery get request and I need to put a variable in the data to retrieve the right information as it is dependent upon other things.
Here’s my jQuery;
$.get("AJAX/get_latest_track.php", function(result){
song = new Audio(result);
$.get("AJAX/get_player.php", { url: song },function(result){
$("#loadInfo").html(result);
});
I need to put the song into the data in the second get request but not sure how to do this
In your second GET request you are sending along an object, you need to send a string.
By sending the object the code will automatically do a song.toString(), which most likely results in the “[object Object]” string being actually sent.