user3095297
user3095297

Reputation: 39

can't make append after jquery load

Inside clientProfile.html I have a div with class name clientName. And after loading the file inside ajax success, I want to append "hi" to that div, but doesn't work.

JS:

function renderClientProfile() {

    $(".wrapper").load("./clientProfile.html");
}

success: function(data) {

   renderClientProfile();
   $(".clientName").append("hi");
}

Upvotes: 2

Views: 97

Answers (1)

Stephen Thomas
Stephen Thomas

Reputation: 14053

Do you mean:

$( ".wrapper" ).load( "./clientProfile.html", function() {
    $(".clientName").append("hi");
});

Upvotes: 1

Related Questions