handing data returned from jquery get request
Posted
by ian
on Stack Overflow
See other posts from Stack Overflow
or by ian
Published on 2010-06-14T05:29:41Z
Indexed on
2010/06/14
5:32 UTC
Read the original article
Hit count: 168
I have a simple jquery script as follows:
$('a').click(function()
{
//get the id of the song we want to play
var song_id = $(this).attr("id");
//do a get request to get the information about the song
$.get("http://www.site.com/v4/ajax/get_song_info.php", { id: song_id, }, function(data)
{
alert("Data Loaded: " + data);
});
//alert( song_id );
});
I have gotten it to work and it returns several bits of data 'artist' 'title' 'song duration' and so on.
How do I process my 'data' so I can then update my page with each bit. In this case I want to set a series of '' to hold each of the values returned.
Thanks.
© Stack Overflow or respective owner