I'm trying to remove this element on success function, but it's not doing it!!
jQuery file:
$(function () {
//More Button
$('.more').live("click", function () {
var ID = $(this).attr("id");
if (ID) {
$("#more" + ID).html('<img src="moreajax.gif" />');
$.ajax({
type: "POST",
url: "ajax_more.php",
data: "lastmsg=" + ID,
cache: false,
success: function (html) {
$("ul.statuses").append(html);
// my problem is here
$("#more" + ID).remove();
}
});
}
else {
$(".morebox").html('The End');
}
return false;
});
});
This is the html file: This is the button that's clicked to retrieve more results!
echo'<div id="more'. $dateTime.'" class="morebox">
<a href="#" class="more" id="'.$dateTime.'">more</a>';