Arsalan
Arsalan

Reputation: 471

jquery ajax populated data issue

I am having a problem with the jquery script, a function Openpopup(pic, this) is called on image click and inside this function i need this $(obj).find('span.class').remove();

function open_popup(pic,obj){           
    $(obj).find('.notice').remove(); // this is not working

    $.ajax ({
        type: "POST",
        url: "includes/load_comments.php",
        data: "cond=fetchdata&pic="+pic,
        success: function(msg){ 
            alert('done');
        }
    });             
}

The issue is that when i comment all that ajax the .remove works. What is wrong, unable to get it to work .. Please HELP!!!

Upvotes: 0

Views: 37

Answers (2)

Sujeesh Balan
Sujeesh Balan

Reputation: 226

Just Use Classname instead of object this will work $(".classname").find('.notice').remove();

Upvotes: 0

Lex Nguyen
Lex Nguyen

Reputation: 401

Try put $(obj).find('.notice').remove(); into ajax success function

Btw, if it's not change your logic

Upvotes: 1

Related Questions