jQuery.get("ajax.php", function(data)
{
prev = $("#newsfeed").html(); //Remember what was in the newsfeed
$(data).find("div[id^='feed']").each(function() //Find every div starting with feed in AJAX response
{
alert('#' + $(this).attr("id")); //Works fine
$('#' + $(this).attr("id")).remove(); //Remove any existing div with same id - Not working
});
$("#newsfeed").html(data + prev); //Append the AJAX response to the top of the page
});
请帮忙,我对 Jquery 比较陌生,不知道出了什么问题。