I have a simple ajax complete call. It's supposed to append some text after an ajax load is complete. It works minus the fact that sometimes it displays the information two or more times. I think I need to include something, but I am not quite sure.
Should I make the jQuery into a function and have called once ajax is done? Any suggestion would be great.
Here is an example of how it's deployed on a site I am developing https://dev.staging.idgadvertising.com/sgwcorp/products
here is my code
jQuery(document).ajaxComplete(function($) {
jQuery('.woof_container_inner_shade').append('<div class="smalldesc">1=Lightest 6=Darkest,7=Multicolor</div>');
jQuery('.woof_shortcode_output .products .product').each(function() {
if (jQuery(this).hasClass('product_cat-everlast')) {
jQuery(this).find('a.product-images').append('<div class="prodBadge">Everlast</div>');
}
if (jQuery(this).hasClass('product_cat-tigerturf')) {
jQuery(this).find('a.product-images').append('<div class="prodBadge">TigerTurf</div>');
}
});
});