I am using the new jQuery triggers to trigger custom actions. This is a sample code:
$(document).bind('awspcAfterCalculatePrice', function(e) {
console.log(new Date().getTime());
});
$(document).bind('awspcBeforeCalculatePrice', function(e) {
console.log(new Date().getTime());
setTimeout(function() {goToNextStep(); }, 500);
});
I want to trigger an event after the call to admin-ajax.php?task=price_callback&action=awspricecalculator_ajax_callback is returned. But it seems the awspcAfterCalculatePrice is triggered earlier, because the style=”display:none” of the awspc-field-row td’s are not changed yet, I need to wait 500ms. Can I hook to that Ajax response somehow?