# Counting numbers did not work in HubSpot Module

**URL:** <https://community.hubspot.com/t/counting-numbers-did-not-work-in-hubspot-module/55282>\
**Category:** CMS Development\
**Tags:** local-development, css, javascript, html\
**Created:** [April 20, 2022, 9:00am UTC](https://community.hubspot.com/t/counting-numbers-did-not-work-in-hubspot-module/55282 "2022-04-20T09:00:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![FAlluqmani](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/falluqmani/32/10553_2.png) [@FAlluqmani](https://community.hubspot.com/u/FAlluqmani)\
**Post date:** [April 20, 2022, 9:00am UTC](https://community.hubspot.com/t/counting-numbers-did-not-work-in-hubspot-module/55282/1 "2022-04-20T09:00:56Z")

</div>

Hello, I’m new to HubSpot development. I used html + css + js(I have used a jQuery plugin and waypoints.js.) to make counting numbers function dynamically. It is working fine normally but when I tested the module html + css + js code on HubSpot, the counting numbers did not work.  
Could somebody please assist me in determining the cause and offering a solution? Thank you in advance!

https://www.loom.com/embed/93d7829546c947de961a7efa66837e21

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [April 20, 2022, 10:29am UTC](https://community.hubspot.com/t/counting-numbers-did-not-work-in-hubspot-module/55282/2 "2022-04-20T10:29:47Z")

</div>

hi @FAlluqmani

You have to paste all your CDN inside module instead of base.html then it will work proper for you in preview mode like this as shown in below image  
\<script src=“[https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.min.js](https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.min.js)”\>\</script\>

\<script src=“[https://cdnjs.cloudflare.com/ajax/libs/Counter-Up/1.0.0/jquery.counterup.min.js](https://cdnjs.cloudflare.com/ajax/libs/Counter-Up/1.0.0/jquery.counterup.min.js)”\>\</script\>

\<script src=“[https://cdnjs.cloudflare.com/ajax/libs/Counter-Up/1.0.0/jquery.counterup.js](https://cdnjs.cloudflare.com/ajax/libs/Counter-Up/1.0.0/jquery.counterup.js)”\>\</script\>

\<script\>

$(‘.counter’).counterUp({

delay: 10,

time: 2000

});

\</script\>

 ![ChehakWadhdwa_0-1650450567315.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/1/e/1e91467811abd087a15167f409da446376bee912.png)

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.  
Thanks and Regards.

---

<div class="post-metadata">

**Author:** ![FAlluqmani](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/falluqmani/32/10553_2.png) [@FAlluqmani](https://community.hubspot.com/u/FAlluqmani)\
**Post date:** [April 20, 2022, 2:25pm UTC](https://community.hubspot.com/t/counting-numbers-did-not-work-in-hubspot-module/55282/3 "2022-04-20T14:25:43Z")

</div>

I try to add this but does not work​☹

https://www.loom.com/embed/451c7b1068644d1dbf97e3d42153527b

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [April 20, 2022, 2:58pm UTC](https://community.hubspot.com/t/counting-numbers-did-not-work-in-hubspot-module/55282/4 "2022-04-20T14:58:08Z")

</div>

@FAlluqmani , are you getting any errors reported in your console?

My first guess is that the library is being called before jquery.

Look for anything like **$ is undefined** or **jquery is undefined**

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [April 21, 2022, 5:55am UTC](https://community.hubspot.com/t/counting-numbers-did-not-work-in-hubspot-module/55282/5 "2022-04-21T05:55:33Z")

</div>

hi @FAlluqmani

Please create one separate Custom module(for testing purpose) and paste below code in (html+hubl) with no any change , if it works proper for you then make modification as per your requirements.

\<div class=“row-fluid”\>

\<div class=“counter-module”\>

\<h2\>\<span class=“counter”\>3000\</span\> \<span\> \</span\>\</h2\>

```
\<h6>Counting Number\</h6>

```

\</div\>

\</div\>

\<script src=“[https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.4.1.min.js](https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.4.1.min.js)”\>\</script\>

\<script src=“[https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.min.js](https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.min.js)”\>\</script\>

\<script src=“[https://cdnjs.cloudflare.com/ajax/libs/Counter-Up/1.0.0/jquery.counterup.min.js](https://cdnjs.cloudflare.com/ajax/libs/Counter-Up/1.0.0/jquery.counterup.min.js)”\>\</script\>

\<script src=“[https://cdnjs.cloudflare.com/ajax/libs/Counter-Up/1.0.0/jquery.counterup.js](https://cdnjs.cloudflare.com/ajax/libs/Counter-Up/1.0.0/jquery.counterup.js)”\>\</script\>

\<script\>

$(‘.counter’).counterUp({

delay: 10,

time: 2000

});

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.  
Thanks and Regards.

\</script\>

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [April 21, 2022, 8:42am UTC](https://community.hubspot.com/t/counting-numbers-did-not-work-in-hubspot-module/55282/6 "2022-04-21T08:42:32Z")

</div>

Hi @FAlluqmani,

could you please post the whole HTML part of the module here? I saw an

`</body>`

and

`</html>`

tag in the last loom video. And those things might break the functionality.

best,

Anton

---

<div class="post-metadata">

**Author:** ![FAlluqmani](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/falluqmani/32/10553_2.png) [@FAlluqmani](https://community.hubspot.com/u/FAlluqmani)\
**Post date:** [April 21, 2022, 11:17am UTC](https://community.hubspot.com/t/counting-numbers-did-not-work-in-hubspot-module/55282/7 "2022-04-21T11:17:30Z")

</div>

Actually, The problem was about the js file linking in HubSpot.  
the solution:  
I have uploaded the required js file in a folder and add three file:  
1.a jQuery file (JavaScript library) .  
2.waypoint js (which is a helper file to detect screen position for the counter)  
3.counter js (which is a file for the counter itself)  
and then add that file link to a specific module. In our case in the counter module.

 ![FAlluqmani_0-1650540150203.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/1X/44b2944a725f9adb62cd045328d72e35c31a2a91.jpeg)

Thank you all for your assistance.

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [April 21, 2022, 12:22pm UTC](https://community.hubspot.com/t/counting-numbers-did-not-work-in-hubspot-module/55282/8 "2022-04-21T12:22:07Z")

</div>

Hello @FAlluqmani,

Please include JQuery CDN above all CND’s in html inside the module like this

\<script src=“[https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.4.1.min.js](https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.4.1.min.js)”\>\</script\>

or you can go through this link also:-

> **[Include jQuery across pages](https://knowledge.hubspot.com/website-pages/include-jquery-across-your-hubspot-pages)**
>
> Learn how to include and manage jQuery across your HubSpot-hosted pages to ensure compatibility with older modules and scripts.

Regards,
