Last day I had to hack a webshop's basket management system, and deleting the items had to be done via AJAX. The problem was, that each call had to wait the previous to be completed, otherwise some products kept in the session. The solution was simple: call the AJAX requests recursively on the 'onComplete' event.
Here is a cleaned up code, using MooTools 1.2.4. Call addAjaxParam() to prepare the ajaxParams array.
var ajaxParams = [];
function addAjaxParam( pid )
{
var obj = {
'option': 'module_shop_action',
'product_id': pid
}
ajaxParams.push( obj );
}
All rights reserved, ©2008-2013 - Built on CodeIgniter framework - Konami codes - Mostly Valid XHTML 1.1 - Valid CSS 2.1