jquery code never executes

Avatar

Avatar
Level 1
gajanr19756109
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile

Avatar
Level 1
gajanr19756109
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile
gajanr19756109
Level 1

05-10-2016

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>

Replies

Avatar

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

93 likes

Total Posts

817 posts

Correct reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

93 likes

Total Posts

817 posts

Correct reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile
ParitMittal
Level 10

12-10-2016

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

Avatar
Level 1
JamesCopeman
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile

Avatar
Level 1
JamesCopeman
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile
JamesCopeman
Level 1

13-10-2016

Hi

 

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

James

Avatar

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

93 likes

Total Posts

817 posts

Correct reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

93 likes

Total Posts

817 posts

Correct reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile
ParitMittal
Level 10

16-10-2016

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