jquery ui - show loader while submitting a form -
i have following code responsible submitting form inside function load().
$(document).ready(function(){ $("#productfilter").validate({ submithandler: function(form) { $.post ('listproresult_core.php', $("#productfilter").serialize(), function(data) { $('#contentincore').html(data); $('#contentincore a').click(function(e) { $("#contentincore").on("click", "a:not(.minlink)" && "a:not(.prolink)", function ( e ) { $("#contentincore").load($(this).attr("href")); e.preventdefault(); }); }); }); } }); });
... however, want response form (while loading) show me next loader .gif
.
$("#contentincore").html("<img src='loader.gif'class='clock' border='0' />");
use ajax post form , can execute 'beforesend'
$.ajax({ type: "post", url: "listproresult_core.php", data: $("#productfilter").serialize(), beforesend: function() { $("#contentincore").html("<img src='loader.gif'class='clock' border='0' />"); }, success: function(result) { $("#contentincore").html(""); } });
Comments
Post a Comment