Jquery before() with animation -
i'm trying make appear result of ajax request using before(). works well, i'd make appear result animation (toggle, slidedown or something).
here code use:
jquery.ajax({ type: "post", url: "/postcom", datatype:"text", data:mydata, success:function(response){ $("#results_com").before(response); $("#formcomtext").val(''); }, error:function (xhr, ajaxoptions, thrownerror){ console.log(thrownerror); } });
html:
<div id="results_com></div>
thanks
if use insertbefore
, might easier:
$(response).insertbefore("#results_com").animate({}, 400);
Comments
Post a Comment