javascript - display data in popup after update -
i try update data in popup , display it
updatecart: function() { ajax_block('#basket-form'); var ajaxended = ajax_load('#basket-form', '<?=$arresult['ajax_call_id']?>', $('#basket-form').serializearray()); $.when(ajaxended).done(function() { bis.updatetopcartfromcart.init(); bis.cartpopup.init('#popup-cart-wrapper'); bis.updatetopcart.init(); }) }
here updatetopcartfromcart function:
bis.updatetopcart = { init: function() { var container = $('#popup-cart-wrapper'); var defupdatedtopcart = new $.deferred(); ajax_block('.top-cart'); var ajaxended = ajax_load('.top-cart', '<?=$arresult['ajax_call_id']?>', $('.top-cart-form').serializearray()); $.when(ajaxended).done(function() { defupdatedtopcart.resolve(); container.html($('.popup')).fadein('fast'); $.fancybox({ content: container, afterload: function() { container.show(); } }); }); return defupdatedtopcart; } }
cartpopup
function:
bis.cartpopup = { init: function(container) { var cartpopuplink = $('.buttcart'); var self = this; } }
and updatetopcart
function:
bis.updatetopcartfromcart = { init: function() { ajax_block('.top-cart'); ajax_load('.top-cart', '<?=$arresult['ajax_call_id']?>', $('.top-cart-form').serializearray()); } }
the problem is, when try update items, it's display 4 times. missing?
Comments
Post a Comment