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

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -