# Javascript counter stopped working

**URL:** <https://community.hubspot.com/t/javascript-counter-stopped-working/10314>\
**Category:** CMS Development\
**Created:** [September 20, 2018, 11:33am UTC](https://community.hubspot.com/t/javascript-counter-stopped-working/10314 "2018-09-20T11:33:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonnyZOO](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jonnyzoo/32/101739_2.png) [@JonnyZOO](https://community.hubspot.com/u/JonnyZOO)\
**Post date:** [September 20, 2018, 11:33am UTC](https://community.hubspot.com/t/javascript-counter-stopped-working/10314/1 "2018-09-20T11:33:07Z")

</div>

Hi there

I’ve noticed that the Javascript counter we use on the below URL has stopped working:

> **[Subtitling Services - ZOO Digital](https://www.zoodigital.com/services/subtitling/)**
>
> You need to reach audiences all around the world. We have the answer. With global capacity across 80+ languages, we deliver the highest-quality subtitles, packaged and ready for all major platforms. On-time. Every time.

In the ‘Built for volume!’ section, the counter should pull through a number from ‘[https://ticker.zoodigital.com/zoosubs\_stats.jsonp](https://ticker.zoodigital.com/zoosubs_stats.jsonp)’, however the backup ‘Working…’ text is displaying instead.

Here’s the code snippet:

```auto
{{ require_js(get_public_template_url("Custom/page/ZOO_Digital_Jan_2017-theme/ZOOsubs_ticker.js")) }} {{ require_js("https://ticker.zoodigital.com/zoosubs_stats.jsonp", "footer") }}
<h2>Built for volume!</h2>
<p>Look how many subtitles and captions we've created and stored securely so far using ZOOsubs.</p>
<h3 id="ZOOsubsTicker">Working...</h3>

```

We’ve not changed anything on the page so can’t understand why it’s behaving differently in the last week or so.

Any ideas what could’ve caused the error? And how it can be fixed?

---

<div class="post-metadata">

**Author:** ![Jsum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jsum/32/20405_2.png) [@Jsum](https://community.hubspot.com/u/Jsum)\
**Post date:** [September 20, 2018, 11:58am UTC](https://community.hubspot.com/t/javascript-counter-stopped-working/10314/2 "2018-09-20T11:58:11Z")

</div>

@JonnyZOO,

first, I wouldn’t recommend loading your scripts in the middle of the page. It would be better to use the head of the document, or better yet the footer if possible.

that being said, you have an error in your console that I am sure is related:

`Uncaught ReferenceError: ZOOsubs_ticker is not defined`

If ‘Zoosubs\_ticker’ was defined and the timer was working, and now it isn’t working, something has to have changed. Maybe it wasn’t to the page directly. Does your site have a central javascript file? Is it possible someone moved some files around? did you recently upgrade the module containing the code (provided it is in a custom module)?

I get the ‘x is not defined’ on inline onclick events when I have my function in the javascript section of the custom module interface. I have to place the javascript in my html with \<script\> tags.

I would suggest trying to revert back to a previous version of the template, not to far back but at least to when you were sure it was working. If it still isn’t working then the issue is coming from outside the template from one of the assets attached to the template.

Need help? [Hire Us Here](https://www.upwork.com/o/companies/_~0124e15ff34efb3871/)

---

<div class="post-metadata">

**Author:** ![JonnyZOO](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jonnyzoo/32/101739_2.png) [@JonnyZOO](https://community.hubspot.com/u/JonnyZOO)\
**Post date:** [September 20, 2018, 12:09pm UTC](https://community.hubspot.com/t/javascript-counter-stopped-working/10314/3 "2018-09-20T12:09:52Z")

</div>

Hi @Jsum

Thanks for the reply. I’ll pass your response over to our dev team to see if they can shed any light.

In terms of reverting back to previous versions, the last revision of the template itself was some time last year. While the associated stylesheet was last edited on the 14/08/18 and the problem only started occuring around 12/09/18.

---

<div class="post-metadata">

**Author:** ![Jsum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jsum/32/20405_2.png) [@Jsum](https://community.hubspot.com/u/Jsum)\
**Post date:** [September 20, 2018, 12:12pm UTC](https://community.hubspot.com/t/javascript-counter-stopped-working/10314/4 "2018-09-20T12:12:05Z")

</div>

@JonnyZOO, hmm… it wouldn’t be the css in most cases, but the template would have been a likely suspect. What about the javascript files associated with the counter?

Need help? [Hire Us Here](https://www.upwork.com/o/companies/_~0124e15ff34efb3871/)

---

<div class="post-metadata">

**Author:** ![JonnyZOO](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jonnyzoo/32/101739_2.png) [@JonnyZOO](https://community.hubspot.com/u/JonnyZOO)\
**Post date:** [September 26, 2018, 11:47am UTC](https://community.hubspot.com/t/javascript-counter-stopped-working/10314/5 "2018-09-26T11:47:49Z")

</div>

Hey @Jsum

Just an update on this, the JavaScript needed linking to the template. I’m guessing this is due to an update in HubSpot’s design manager, as I can’t remember seeing this option a few weeks back.

 ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/0/2/02216248de75e914dda15affbf250ec09130cbd3.png)

Thanks anyway for your help.

---

<div class="post-metadata">

**Author:** ![Jsum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jsum/32/20405_2.png) [@Jsum](https://community.hubspot.com/u/Jsum)\
**Post date:** [September 26, 2018, 5:34pm UTC](https://community.hubspot.com/t/javascript-counter-stopped-working/10314/6 "2018-09-26T17:34:08Z")

</div>

That has always been there but I’m glad you found it. I thought it might be. If yours or any of these answers helped please mark them as the solution for others.

Need help? [Hire Us Here](https://www.upwork.com/o/companies/_~0124e15ff34efb3871/)

---

<div class="post-metadata">

**Author:** ![JonnyZOO](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jonnyzoo/32/101739_2.png) [@JonnyZOO](https://community.hubspot.com/u/JonnyZOO)\
**Post date:** [September 27, 2018, 8:02am UTC](https://community.hubspot.com/t/javascript-counter-stopped-working/10314/7 "2018-09-27T08:02:13Z")

</div>

Strange, as we hadn’t changed the template at all before the counter stopped working, yet this was the only step that fixed the issue.
