Title: [Plugin: WordPress SEO by Yoast] Page Edit JavaScript Errors
Last modified: August 19, 2016

---

# [Plugin: WordPress SEO by Yoast] Page Edit JavaScript Errors

 *  Resolved [Tim Nolte](https://wordpress.org/support/users/tnolte/)
 * (@tnolte)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-page-edit-javascript-errors/)
 * When using this plugin I’m getting JavaScript errors in wp-seo-metabox.js(_line
   260_) on Page Edit. This is breaking just about all of the JavaScript on the 
   page. In Google Chrome I get the following report:
 *     ```
       Uncaught TypeError: Object function each(iterator, context) {
           var index = 0;
           try {
             this._each(function(value) {
               iterator.call(context, value, index++);
             });
           } catch (e) {
             if (e != $break) throw e;
           }
           return this;
         } has no method 'replace'
       ```
   
 * In Firefox 3.6 I get:
 *     ```
       keywords[i].replace is not a function
       [Break On This Error] var urlfocuskw = keywords[i].replace(' ','-').toLowerCase();
       ```
   
 * In Safari I get:
 *     ```
       TypeError: Result of expression 'keywords[i].replace' [undefined] is not a function.
       ```
   
 * I had to make a couple of code changes in order to keep the JavaScript from breaking.
   Can anyone else confirm there is an error here? I’ve gone through and disabled
   all of my other plugins only to still have this issue remain.
 * [http://wordpress.org/extend/plugins/wordpress-seo/](http://wordpress.org/extend/plugins/wordpress-seo/)

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

 *  [browndp08](https://wordpress.org/support/users/browndp08/)
 * (@browndp08)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-page-edit-javascript-errors/#post-2016426)
 * I get the same error. It is not letting me upload any media into a post.
 *  Plugin Contributor [Joost de Valk](https://wordpress.org/support/users/joostdevalk/)
 * (@joostdevalk)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-page-edit-javascript-errors/#post-2016448)
 * Which version of WP and which version of the plugin are you using?
 *  Thread Starter [Tim Nolte](https://wordpress.org/support/users/tnolte/)
 * (@tnolte)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-page-edit-javascript-errors/#post-2016450)
 * WordPress 3.0.5
    WordPress SEO 0.2.3.3
 *  Plugin Contributor [Joost de Valk](https://wordpress.org/support/users/joostdevalk/)
 * (@joostdevalk)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-page-edit-javascript-errors/#post-2016451)
 * Update already, both to WordPress 3.1.1 (there’s a security hole in your current
   version) as to WordPress SEO 0.2.5.2 🙂
 *  Thread Starter [Tim Nolte](https://wordpress.org/support/users/tnolte/)
 * (@tnolte)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-page-edit-javascript-errors/#post-2016452)
 * Yes well it would be nice if it was that simple. Since they have uppdated the
   TinyMCE in WP 3.1 this is going to break some key features of our install. I 
   do see that there is an update for WP SEO which I will try. Just a comment though
   is that if this plugin is only intended to work with 3.1 then it should be tagged
   that way. Maybe it is and I missed that. Does the latest version of WP SEO fix
   the JavaScript errors?
 *  Plugin Contributor [Joost de Valk](https://wordpress.org/support/users/joostdevalk/)
 * (@joostdevalk)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-page-edit-javascript-errors/#post-2016453)
 * Yes it fixes the JavaScript errors (I think).
 * If you can’t update, you’re doing it wrong. The plugin does not required WP 3.1,
   the security of your blog however, does require that you upgrade.
 *  Thread Starter [Tim Nolte](https://wordpress.org/support/users/tnolte/)
 * (@tnolte)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-page-edit-javascript-errors/#post-2016454)
 * I guess I’m not sure what you mean about if I can’t update I’m doing it wrong.
   Not sure if you mean my WordPress install or the plugin install. I can technically
   update both, that is not the problem, I just can’t afford to break the website
   and risk our users not being able to use our custom built plugins that rely on
   TinyMCE. I will try updating the plugin tonight though. Thanks for the great 
   plugin and all of the time you’ve put into it!
 *  Thread Starter [Tim Nolte](https://wordpress.org/support/users/tnolte/)
 * (@tnolte)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-page-edit-javascript-errors/#post-2016462)
 * OK, well I updated to the latest version of the plugin in our Dev environment.
   Still getting the same JavaScript error. The error is occurring on line 200 instead
   of 260 now, but nevertheless it’s still broken. I’m curious if this has something
   to do with the jQuery that our site uses. I’m using the Google APIs jQuery, matching
   the same version that comes with WP 3.0.x but I’m also using the Google APIs 
   jQuery UI with some extra components as well. I’ll just have to go in again and
   modify the JS to prevent the issue form breaking all the JS on the Page edit.
 *  Thread Starter [Tim Nolte](https://wordpress.org/support/users/tnolte/)
 * (@tnolte)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-page-edit-javascript-errors/#post-2016463)
 * Another possibility for the issues could be related to my use of the More Fields
   plugin. I wouldn’t think this would be a problem but it is another plugin that
   makes changes to the Page edit page.
 *  Plugin Contributor [Joost de Valk](https://wordpress.org/support/users/joostdevalk/)
 * (@joostdevalk)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-page-edit-javascript-errors/#post-2016465)
 * Hmm are you entering html tags in to the focus keyword field by any chance? I’ve
   added a fix to 0.2.5.3, coming later today, that might resolve this but not 100%
   sure.
 * Also re: you’re doing it wrong: you should always be able to upgrade your WordPress
   install. If you’re not, I seriously think you’re doing something wrong.
 *  Thread Starter [Tim Nolte](https://wordpress.org/support/users/tnolte/)
 * (@tnolte)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-page-edit-javascript-errors/#post-2016479)
 * Ok, well I didn’t get a chance to upgrade to 0.2.5.3, however I just upgraded
   to 0.2.5.4 and I’m getting the same error but now on line 66:
 *     ```
       Uncaught TypeError: Object function each(iterator, context) {...
       ...} has no method 'replace'
       wp-seo-metabox.js:66
       ```
   
 * On the final note, as far as doing something wrong, then that would seem to be
   the problem for every plugin developer. When WordPress changes core functionality
   that a plug relies on and then the plugin is broken how is that the plugin develop
   did something wrong. I may be able to upgrade without a problem, however I already
   do know that the TinyMCE Advanced plugins was(maybe still is) broken because 
   of the TinyMCE changes in 3.1.
 *  Plugin Contributor [Joost de Valk](https://wordpress.org/support/users/joostdevalk/)
 * (@joostdevalk)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-page-edit-javascript-errors/#post-2016487)
 * The next release of the plugin will feature a load of changes to all the JS for
   the metabox, most of them improving speed and stability, give it a go once it
   comes out!
 *  Thread Starter [Tim Nolte](https://wordpress.org/support/users/tnolte/)
 * (@tnolte)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-page-edit-javascript-errors/#post-2016522)
 * Joost,
 * I have again found a javascript bug in wp-seo-metabox.js with the error:
 *     ```
       Uncaught TypeError: Object function each(iterator, context) {
           var index = 0;
           try {
             this._each(function(value) {
               iterator.call(context, value, index++);
             });
           } catch (e) {
             if (e != $break) throw e;
           }
           return this;
         } has no method 'replace'
       ```
   
 * I did some debugging in Google Chrome and found that for some reason in the function
   boldKeywords() when you are iterating over the keywords array it somehow is trying
   to iterate using an entire ‘each’ function as the key value. What I had to do
   was change the for loop to use a standard counter with a limit of the keywords.
   length.
 * Line 179:
    original `for (var i in keywords) {` mine `for (var i=0;i<keywords.
   length;i++) {` using my change I no longer get an error and this also doesn’t
   break the rest of the javascript in the page.
 *  Plugin Contributor [Joost de Valk](https://wordpress.org/support/users/joostdevalk/)
 * (@joostdevalk)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-page-edit-javascript-errors/#post-2016525)
 * Ha, tnolte, you’re a bloody hero. That fixed it, coming up in 1.0.1

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

The topic ‘[Plugin: WordPress SEO by Yoast] Page Edit JavaScript Errors’ is closed
to new replies.

 * ![](https://ps.w.org/wordpress-seo/assets/icon-256x256.gif?rev=3419908)
 * [Yoast SEO - Advanced SEO with real-time guidance and built-in AI](https://wordpress.org/plugins/wordpress-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-seo/reviews/)

 * 14 replies
 * 3 participants
 * Last reply from: [Joost de Valk](https://wordpress.org/support/users/joostdevalk/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-page-edit-javascript-errors/#post-2016525)
 * Status: resolved