jQuery function after .append

后端 未结 19 2334
栀梦
栀梦 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:53
    $('#root').append(child);
    // do your work here
    

    Append doesn't have callbacks, and this is code that executes synchronously - there is no risk of it NOT being done

    0 讨论(0)
提交回复
热议问题