简体   繁体   中英

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");
}

Do you mean:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM