Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Testing Markdown Reply To: Testing Markdown

#177735
Justin Sainton
Participant

`
ajax_callback = function(response) {
var checklist, color, set_id, existing_set, content;
if (response.is_successful) {
checklist = $(‘.variation_checkboxes’);
content = $(response.obj.content);
set_id = content.attr(‘id’);
existing_set = checklist.find(‘#’ + set_id);
if (existing_set.size() > 0) {
existing_set.find(‘.children’).append(content.find(‘.children .ajax’));
} else {
checklist.append(content);
}

                    color = checklist.find('li').css('backgroundColor') || '#FFFFFF';
                    checklist.find('.ajax').
                        animate({ backgroundColor: '#FFFF33' }, 'fast').
                        animate({ backgroundColor: color }, 'fast', function(){
                            $(this).css('backgroundColor', 'transparent');
                        }).
                        removeClass('ajax');
                } else {
                    alert(response.error.messages.join("\n"));
                }
                form.hide().find('input:text').val('');
                form.find('label').show().css('opacity', '1');
                spinner.toggleClass('ajax-feedback-active');
            };

`