Title: Lots of Javascript errors
Last modified: September 12, 2016

---

# Lots of Javascript errors

 *  Resolved [Richard Vencu](https://wordpress.org/support/users/rvencu/)
 * (@rvencu)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/lots-of-javascript-errors/)
 * Hi, since Loco Translate v2 I really cannot use this plugin properly anymore…
 * When I activate v2 I get javascript errors when I try to save the work done or
   sync. The error says
    prototype.js?ver=1.7.1:845 Uncaught TypeError: this._each
   is not a function
 * Then if I switch back to v1.x version I get different errors, for instance I 
   cannot search/filter the translation/translated phrases. Luckily I can save mo
   and po files in this version. I waited to see improvements over new versions 
   but I seem to be stuck on this. I had to move my translation work on external
   Poedit software and perform ftp uploads manually. Not a bad thing since I discovered
   the latest Poedit software notifies on translation problems (for instance the
   count of missing %s and other variables present in original strings). This would
   be nice to have on Loco plugin as well.

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

 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/lots-of-javascript-errors/#post-8177046)
 * My plugin does not use `prototype.js` so I don’t know how this error could be
   coming from my JavaScript. If you know differently, please elaborate.
 * Regarding additional editor features such as formatting tokens. These are planned
   for future development. Thanks for confirming the need for them.
 *  Thread Starter [Richard Vencu](https://wordpress.org/support/users/rvencu/)
 * (@rvencu)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/lots-of-javascript-errors/#post-8177074)
 * Hm. This is the chain
 *     ```
       prototype.js?ver=1.7.1:845 Uncaught TypeError: this._each is not a function
       each @ prototype.js?ver=1.7.1:845
       m.register.d.clear @ admin.js?ver=2.0.6:88
       k @ admin.js?ver=2.0.6:90
       m.register.d.post @ admin.js?ver=2.0.6:92
       doSyncAction @ editor.js?ver=2.0.6:77
       (anonymous function) @ editor.js?ver=2.0.6:204
       dispatch @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils&ver=9ff1ced…:3
       r.handle @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils&ver=9ff1ced…:3
       ```
   
 * So prototype.js is called from admin.js that is part of your plugin. I do not
   know why it does this call.
    -  This reply was modified 9 years, 8 months ago by [Richard Vencu](https://wordpress.org/support/users/rvencu/).
      Reason: cleaner code
 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/lots-of-javascript-errors/#post-8177091)
 * It can’t be called directly. My Js only calls jQuery directly.
 * I notice that the current version of WordPress doesn’t include a file called 
   prototype.js, so my guess is that this file is included by some other plugin 
   and is messing things up. something with a version number of 1.7.1 by the looks
   of it. Can you see what plugin this is? or perhaps your theme?
 *  Thread Starter [Richard Vencu](https://wordpress.org/support/users/rvencu/)
 * (@rvencu)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/lots-of-javascript-errors/#post-8177129)
 * I see that prototype.js is loading automatically from [https://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js?ver=1.7.1](https://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js?ver=1.7.1)
 * Chrome dev tools says the initiator of this download is [https://www.dentfix.ro/wp-admin/admin.php?path=plugins%2Floco-translate%2Fold%2Flanguages%2Floco-translate-pl_PL.po&bundle=loco-translate%2Floco.php&domain=loco-translate&page=loco-plugin&action=file-edit](https://www.dentfix.ro/wp-admin/admin.php?path=plugins%2Floco-translate%2Fold%2Flanguages%2Floco-translate-pl_PL.po&bundle=loco-translate%2Floco.php&domain=loco-translate&page=loco-plugin&action=file-edit)
   and that would be the admin page I am on…
 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/lots-of-javascript-errors/#post-8177171)
 * Ok, I can see that WordPress will add this script from the remote source, but
   for whatever reason my admin pages don’t include it. What version of WordPress
   are you running?
 * The apparently offending line 88 of admin.js includes a standard `for` loop. 
   I am clueless as to how this ends up calling the `each` function in prototype.
   js
 * Although the admin.js code is compressed I could debug it, but I’ll need to reproduce
   the error and currently I cannot. We need to establish why your admin pages are
   loading Prototype and mine are not.
 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/lots-of-javascript-errors/#post-8177190)
 * Ah. I can reproduce it by forcing WordPress to include prototype.js.
 * Looking into a fix for this conflict…
 *  Thread Starter [Richard Vencu](https://wordpress.org/support/users/rvencu/)
 * (@rvencu)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/lots-of-javascript-errors/#post-8177213)
 * I downloaded the entire plugins folder and themes folder in order to fileseek“
   prototype.js” against all plugin files. No result. Perhaps your finding is correct.
 * In my multisite installation (I run some common and some different plugins on
   each site) the issue appears only on one site. So it could be something related
   to the theme.
 *  Thread Starter [Richard Vencu](https://wordpress.org/support/users/rvencu/)
 * (@rvencu)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/lots-of-javascript-errors/#post-8177221)
 * I use WordPress 4.6.1 – it is specified on the left sidebar of this thread since
   it is a required info to start a support topic
 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/lots-of-javascript-errors/#post-8177238)
 * …
    -  This reply was modified 9 years, 8 months ago by [Tim W](https://wordpress.org/support/users/timwhitlock/).
      Reason: accidentally posted twice
 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/lots-of-javascript-errors/#post-8177240)
 * Fixed it.
 * The issue was that prototype.js (included as a dependency of something else you’re
   running) alters the Array prototype by adding methods to it. These show up during`
   for..in` iteration, hence breaking my code.
 * I’ve change the iteration to use the numerical form, which fixed the conflict.
   
   This is in the current development version `2.0.7-dev` [https://localise.biz/wordpress/plugin/developers](https://localise.biz/wordpress/plugin/developers)
 *  Thread Starter [Richard Vencu](https://wordpress.org/support/users/rvencu/)
 * (@rvencu)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/lots-of-javascript-errors/#post-8177298)
 * Great

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

The topic ‘Lots of Javascript errors’ is closed to new replies.

 * ![](https://ps.w.org/loco-translate/assets/icon-256x256.png?rev=1000676)
 * [Loco Translate](https://wordpress.org/plugins/loco-translate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/loco-translate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/loco-translate/)
 * [Active Topics](https://wordpress.org/support/plugin/loco-translate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/loco-translate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/loco-translate/reviews/)

## Tags

 * [javascript errors](https://wordpress.org/support/topic-tag/javascript-errors/)

 * 11 replies
 * 2 participants
 * Last reply from: [Richard Vencu](https://wordpress.org/support/users/rvencu/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/lots-of-javascript-errors/#post-8177298)
 * Status: resolved