JQuery ile bir elemanı kaldırarak bir sorun yaşıyorum

0 Cevap php

Ben başarı işlevi bu eleman çıkarmak için çalışıyorum, ama bunu yapmıyor!

jQuery dosyası:

 $(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>';

0 Cevap