Expand my Community achievements bar.

Applications for the 2024 Adobe Target Community Mentorship Program are open! Click to the right to learn more about participating as either an Aspirant, to professionally level up with a new Certification, or as a Mentor, to share your Adobe Target expertise and inspire through your leadership! Submit your application today.

jquery code never executes

Avatar

Level 1

Hi,

Trying to execute below code in custom code of an activity.

https://diceholdings.marketing.adobe.com/content/mac/diceholdings/target/activities.html#activitydet...

Can anyone please help me in getting to what I am missing here.

<script type="text/javascript">
jQuery(document).ready(function(){

    alert("DOM is ready");
    
    // wait until window is loaded (images, links etc...)
    window.onload = function() {
        
        alert("window is loaded");
      
      jQuery('.price-wrap').each({
        var storePrice = jQuery(this).children('strong');
        jQuery(this).children('strong').remove();
        var getPriceWrap = jQuery(this).text();
        getPriceWrap.replace('total','');
        jQuery(this).html(getPriceWrap);
        jQuery(this).prepend(storePrice);
      });
  });
</script>

3 Replies

Avatar

Level 10

Hi Gajan,

We think there’s a syntax error with the jQuery too.  I would recommend starting with basic javascript console.log statements to make sure they understand the order of operations, check that jQuery is defined, etc.

Thanks & Regards

Parit Mittal

Avatar

Level 1

Hi

 

I'm having a similar issue with jQuery and can't even get console.log statements to show.

James

Avatar

Level 10

Hi James & Gajan ,

Can you please share the url of your website as well as the account details in a private message so that we can debug the issue at our end.

Thanks & Regards

Parit Mittal