1
我有一个简单的jQuery脚本如下:移交数据
$('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);
});
我得到它的工作,它返回的数据'艺术家“称号”“的歌曲时长”及几个位等等。
如何处理我的'数据',然后我可以用每一位更新我的页面。在这种情况下,我想设置一系列“'来保存每个返回的值。
谢谢。
我使用访问PHP所以而不是回声'什么'我需要做什么,PHP是否输出一个JSON对象? – ian 2010-06-14 05:52:51
如果您使用PHP5,请尝试'echo json_encode(aPHPObject)'。 – 2010-06-14 05:54:00