Jquery: How to clear an element before appending new content?

前端 未结 4 1819
情话喂你
情话喂你 2020-12-30 19:34

This is my jquery code

 $.ajax({
   url: \"PopUpProductDetails.aspx\",
            cache: false
     }).done(function (html) {
     $(\"#dialog\").append(htm         


        
4条回答
  •  心在旅途
    2020-12-30 19:54

    Inside the function clear the dialog first and then fill up with the content

    $.ajax({
       url: "PopUpProductDetails.aspx",
                cache: false
         }).done(function (html) {
         $("#dialog").html("");
         $("#dialog").html(html);
     });
    

提交回复
热议问题