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

前端 未结 4 1786
情话喂你
情话喂你 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:59

    in case you need to clear the dialog first use .empty() which is faster than .html("")

    see Jquery Difference .html("") vs .empty()

提交回复
热议问题