jquery event after html() function

前端 未结 5 1185
情话喂你
情话喂你 2021-01-11 19:05

Is there a way to launch an event after html() has been fired? Such as:

$.post(\"ajax.php\", {data :data}, function(data){
   $(\"#countries\").html(data, fu         


        
5条回答
  •  长情又很酷
    2021-01-11 19:43

    html() is a synchronous operation, not an event, and so it would not logically accept a callback.

    Just put your code after it:

    $('container').html(data);
    alert('test');
    

提交回复
热议问题