Title: JavaScript error in public.js
Last modified: April 6, 2023

---

# JavaScript error in public.js

 *  Resolved [Jon Harvey](https://wordpress.org/support/users/webdeveloperjon/)
 * (@webdeveloperjon)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/javascript-error-in-public-js/)
 * Hi there, since updating to the latest plugin version, 9.3.5 a couple of days
   ago, we’ve been getting a JS/jQuery error which is then preventing other javascript
   from running, for example, loading forms on pages.
 * Although I’ve linked to the above, we’ve had to disable the plugin on the site
   as our client has a campaign at the moment linking to the form and we need it
   available.
 * If you could look into this, that would be appreciated.
 * The error appears to be caused by code in the public.js file:
 * Uncaught TypeError: Cannot read properties of undefined (reading ‘length’)
   at
   Function.each (jquery.min.js:2:2732)at HTMLDocument. (public.js:2106:15)at j (
   jquery.min.js:2:26794)at Object.fireWith [as resolveWith](https://wordpress.org/support/topic/javascript-error-in-public-js/27607?output_format=md)
   at Function.ready (jquery.min.js:2:29401)at HTMLDocument.I (jquery.min.js:2:29592)
 * Which is the following loop:
 * $.each(Utils.utmTerms, function (index, name) {
    Cookies.remove(‘pys_’ + name)});
 * Thank you.
 * Jon
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fjavascript-error-in-public-js%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [PixelYourSite](https://wordpress.org/support/users/pixelyoursite/)
 * (@pixelyoursite)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/javascript-error-in-public-js/#post-16633267)
 * It seems you no longer have the plugin active on the site, so it’s impossible
   to look into the problem. I suggest you activate the plugin, and clear all caches.
   If the problem persist, contact us on the site directly, we will need some more
   context: [https://www.pixelyoursite.com/contact](https://www.pixelyoursite.com/contact)
 *  Thread Starter [Jon Harvey](https://wordpress.org/support/users/webdeveloperjon/)
 * (@webdeveloperjon)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/javascript-error-in-public-js/#post-16633307)
 * Thank you. We have tried clearing all the caches. 
   What we’ll do is trigger a
   staging copy of the site, and reactivate the plugin on there – then we’ll drop
   you a line so you can have a look. With the plugin active it appeared to be preventing
   crucial forms from showing, so we had to disable it – but apprecaite you then
   don’t have anything to look at!
 * Thank you, Jon
 *  Plugin Author [PixelYourSite](https://wordpress.org/support/users/pixelyoursite/)
 * (@pixelyoursite)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/javascript-error-in-public-js/#post-16633317)
 * Staging copy is perfect, send us the details here: [https://www.pixelyoursite.com/contact](https://www.pixelyoursite.com/contact)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘JavaScript error in public.js’ is closed to new replies.

 * ![](https://ps.w.org/pixelyoursite/assets/icon-256x256.jpg?rev=3178123)
 * [PixelYourSite - Your smart PIXEL (TAG) & API Manager](https://wordpress.org/plugins/pixelyoursite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pixelyoursite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pixelyoursite/)
 * [Active Topics](https://wordpress.org/support/plugin/pixelyoursite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pixelyoursite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pixelyoursite/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [PixelYourSite](https://wordpress.org/support/users/pixelyoursite/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/javascript-error-in-public-js/#post-16633317)
 * Status: resolved