Title: JavaScript error effecting Visual/Text Editor
Last modified: August 22, 2016

---

# JavaScript error effecting Visual/Text Editor

 *  Resolved [kylmorg](https://wordpress.org/support/users/kylmorg/)
 * (@kylmorg)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/javascript-error-effecting-visualtext-editor/)
 * So I’ve been having an issue with my back-end that doesn’t allow me to switch
   from Visual to Text layout when adding a new post. I’ve thoroughly researched
   this problem and tried EVERYTHING (disable plugins, change theme, re-upload WP
   directories and files, etc.)
 * I’ve boiled it down to what I think is a JavaScript issue causing this problem.
   When I open a new post and then run JavaScript Console, the following errors 
   come up:
 * > [View post on imgur.com](https://imgur.com/2UG2DnF)
 * Any suggestions on how I can repair these? Thanks.

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

 *  [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/javascript-error-effecting-visualtext-editor/#post-5353441)
 * The first file-not-found in the console is wp-tinymce.js. This file is not in
   the WordPress install zip file, which instead has the much smaller wp-tinymce.
   js.gz. What’s supposed to happen is that the WordPress install script should 
   unpack the gz to make the required file.
 * The unpacking is not happening. Best guess, and I’m not confident about this 
   bit, is that your host has mod_security enabled on apache, and this disables 
   gz unpacking. See the post about GZIP on [this](http://www.hostjury.com/reviews/Namecheap)
   page.
 * So two possible solutions suggest themselves. Either contact your host tech support
   about the problem, ask if they have mod_security enabled, ask is this likely 
   to disable gz unpacking, and if so can they disable mod_security for your account
   so that WordPress will install correctly. Then reinstall WordPress from Admin
   page > Dashboard > Updates.
 * Or, download wordpress-4.0.zip to your hard drive, find wp-tinymce.js.gz, unpack
   it on your hard drive, upload wp-tinymce.js to the path given in the console 
   error. This should resolve the first file-not-found error. Repeat this procedure
   for the other file-not-found errors. Repeat the whole thing every time WordPress
   is updated.
 *  Thread Starter [kylmorg](https://wordpress.org/support/users/kylmorg/)
 * (@kylmorg)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/javascript-error-effecting-visualtext-editor/#post-5353442)
 * Okay so your first solution isn’t the issue. I’ve switched hosts recently and
   the problem was present on the old and new hosts. Now I’ve got the problem down
   to 1 issue and I’ve seen it on a ton of google searches.
 * There’s an issue with jquery in that tinymce is not defined. It reads as such:
 * ncaught ReferenceError: tinyMCE is not defined
 * So far from googling, the best answer I’ve found is the LAST answer on this post:
   
   [http://stackoverflow.com/questions/14352407/jquery-error-tinymce-is-not-defined-on-wordpress-admin-panel](http://stackoverflow.com/questions/14352407/jquery-error-tinymce-is-not-defined-on-wordpress-admin-panel)
 * The only problem for me is I don’t know what I’m supposed to change and where
   I’m supposed to make $compressed=0. The code mentioned in that article looks 
   like this for me:
 *     ```
       if ( $tmce_on ) {
       			if ( $compressed ) {
       				echo "<script type='text/javascript' src='{$baseurl}/wp-tinymce.php?c=1&$version'></script>\n";
       			} else {
       				echo "<script type='text/javascript' src='{$baseurl}/tiny_mce.js?$version'></script>\n";
       				echo "<script type='text/javascript' src='{$baseurl}/wp-tinymce-schema.js?$version'></script>\n";
       ```
   
 *  [kmessinger](https://wordpress.org/support/users/kmessinger/)
 * (@kmessinger)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/javascript-error-effecting-visualtext-editor/#post-5353445)
 * That so-called solution was not for 4.0. You never want to change core files.
 * You can use ftp or the file manager provided by your host to upload the wp-includes/
   js/tinymce folder. Try that (as suggested by [@lorro](https://wordpress.org/support/users/lorro/)).
 *  Thread Starter [kylmorg](https://wordpress.org/support/users/kylmorg/)
 * (@kylmorg)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/javascript-error-effecting-visualtext-editor/#post-5353446)
 * Thanks. I’ve uploaded a fresh version of that folder and it still doesn’t work.
   One of the problems is that the Java console says it’s looking for two specific
   files in that folder that just don’t exist.
 * 1. tiny_mce.js
    2. wp-tinymce-schema.js
 *  [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/javascript-error-effecting-visualtext-editor/#post-5353448)
 * If it happened on old and new hosts it could just mean that both hosts had mod_security
   enabled. I still think its worth adding the question. If mod_security is disabled
   fixes the issue, it would be a permanent fix.
 * But to answer your last question, the file is
    wp-includes/class-wp-editor.php
   and the new line goes in like this:
 *     ```
       if ( $tmce_on ) {
           $compressed = 0;
           if ( $compressed ) {
       ```
   
 * at line 1071 if you are using WordPress 4.0. I’m not able to test this fix since
   gz unpacking works on my host. You will need to redo this edit for each WordPress
   update.
 *  [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/javascript-error-effecting-visualtext-editor/#post-5353449)
 * My solution 2 was to unpack the .gz on your hard drive to make the missing file,
   and upload this file, not to upload the folder.
 *  Thread Starter [kylmorg](https://wordpress.org/support/users/kylmorg/)
 * (@kylmorg)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/javascript-error-effecting-visualtext-editor/#post-5353450)
 * Yes and when I unpack the .gz the only file that is unpacked is wp-tinymce.js
 *  [kmessinger](https://wordpress.org/support/users/kmessinger/)
 * (@kmessinger)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/javascript-error-effecting-visualtext-editor/#post-5353453)
 * AFAIK, those files have not been used since WP3.6.
 * Securi shows your upgrade went wrong somewhere.
 * > WordPress version: WordPress 4.0
   >  Wordpress version from source: 3.6 Wordpress
   > Version 3.6 based on: [http://thatwasjunk.com//wp-admin/js/common.js](http://thatwasjunk.com//wp-admin/js/common.js)
   > All in One SEO Pack version: 2.2.3.1 WordPress theme: [http://thatwasjunk.com/wp-content/themes/twentytwelve/](http://thatwasjunk.com/wp-content/themes/twentytwelve/)
   > Wordpress internal path: /home/thattesa/public_html/wp-content/themes/twentytwelve/
   > index.php WordPress version outdated: Upgrade required. Outdated WordPress 
   > Found: WordPress Under 4.0
 *  Thread Starter [kylmorg](https://wordpress.org/support/users/kylmorg/)
 * (@kylmorg)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/javascript-error-effecting-visualtext-editor/#post-5353454)
 * Huh, weird. So how do I go about uploading a fresh version of 4.0?
 * I did this just recently based on another help thread I had started. I replaced
   the wp-admin & wp-includes directories completely and left my wp-content directory
   alone as I was instructed to. Also didn’t replace the wp-config.php file but 
   replaced all other loose files sitting in my /wp/ directory.
 *  Thread Starter [kylmorg](https://wordpress.org/support/users/kylmorg/)
 * (@kylmorg)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/javascript-error-effecting-visualtext-editor/#post-5353455)
 * Ha jesus. Just did a re-install and everything’s working now. Had no idea it 
   didn’t correctly upgrade. PROBLEM SOLVED.

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

The topic ‘JavaScript error effecting Visual/Text Editor’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 10 replies
 * 3 participants
 * Last reply from: [kylmorg](https://wordpress.org/support/users/kylmorg/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/javascript-error-effecting-visualtext-editor/#post-5353455)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
