jquery event after html() function

前端 未结 5 1166
情话喂你
情话喂你 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:37

    No but there is no reason you couldn't do this:

    $.post("ajax.php", {data :data}, function(data){
       $("#countries").html(data);
       var id = $("#countries option:selected").attr("id");
       getRegions(id);
    });
    

提交回复
热议问题