jQuery function after .append

后端 未结 19 2438
栀梦
栀梦 2020-11-27 15:25

How to call a function after jQuery .append is completely done?

Here\'s an example:

$(\"#root\").append(child, function(){
   // Action          


        
19条回答
  •  盖世英雄少女心
    2020-11-27 15:47

    I came across the same problem and have found a simple solution. Add after calling the append function a document ready.

    $("#root").append(child);
    $(document).ready(function () {
        // Action after append is completly done
    });

提交回复
热议问题