WordPress.org

Support

Support » How-To and Troubleshooting » realTinyMCE is not defined

realTinyMCE is not defined

  • I really hoped 2.1.1 was going to fix this, but alas not.

    I get the titular error when trying to write a post or page with the ‘Visual Editor’ on.

    I’m fairly sure it’s something to do with the GZIPing of the relevant JS file(s), but changing the GZIP option makes no difference to this problem.
    GZIP option does affect the main blog as it should (confirmed via whatismyip.org).

    Same problem in IE6/7/Firefox2.
    I’ve not done anything to the .htaccess file, nor any server settings.

    Host is Dreamhost. Blog address: http://blog.carbon-360.com/

    Any help will be much appreciated.

Viewing 15 replies - 1 through 15 (of 49 total)
  • Do you have *any* plugins activated which have Javascript files associated with them? It’s possible that their scripts are interfering.

    My issue was resolved by removing all the plugins.
    Am in the slow process of bring them back one by one, but haven’t found the culprit yet.

    Jazzle –

    Did your issue stay resolved? Or has the problem returned?

    I found that CTRL-REFRESH sometimes fixes the missing MCE problem, but then if I refresh repeatedly, the problem comes back.

    Travis

    My guess is that the problem has something to do with the order in which Javascript blocks are being executed. If the one that needs MCE objects and methods is executed before those objects and methods are defined, we get a Javascript error.

    Shift-refreshing the browser seems to force the Javascript to run in a specific order (probably because the cache is flushed).

    Normal refreshing, however, seems to allow browser caching to interfere with the javascript execution order. I’m guessing that some of the javascript is reloaded and some is cached.

    Here’s the Javascript that I see in the head of my [b]Create New Post[/b] page:

    <script type="text/javascript">
    //<![CDATA[
    function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}else{ var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}
    //]]>
    </script>
    <style type="text/css">* html { overflow-x: hidden; }</style>
    <script type='text/javascript' src='http://MY-SITE.COM/wordpress/wp-includes/js/fat.js?ver=1.0-RC1_3660'></script>
    <script type='text/javascript' src='http://MY-SITE.COM/wordpress/wp-includes/js/prototype.js?ver=1.5.0'></script>
    <script type='text/javascript' src='http://MY-SITE.COM/wordpress/wp-includes/js/tw-sack.js?ver=1.6.1'></script>
    <script type='text/javascript' src='http://MY-SITE.COM/wordpress/wp-includes/js/autosave-js.php?ver=20070116'></script>
    <script type='text/javascript' src='http://MY-SITE.COM/wordpress/wp-includes/js/dbx.js?ver=2.05'></script>
    <script type='text/javascript' src='http://MY-SITE.COM/wordpress/wp-admin/dbx-admin-key-js.php?ver=3651&amp;pagenow=post-new.php'></script>
    <script type='text/javascript' src='http://MY-SITE.COM/wordpress/wp-includes/js/wp-ajax-js.php?ver=20070118'></script>
    <script type='text/javascript' src='http://MY-SITE.COM/wordpress/wp-includes/js/list-manipulation-js.php?ver=20070118'></script>
    <script type='text/javascript' src='http://MY-SITE.COM/wordpress/wp-admin/custom-fields.js?ver=3733'></script>
    <script type='text/javascript' src='http://MY-SITE.COM/wordpress/wp-admin/cat-js.php?ver=20070118'></script>
    <script type='text/javascript' src='http://MY-SITE.COM/wordpress/wp-includes/js/tinymce/tiny_mce_gzip.php?ver=20061113'></script>
    <script type='text/javascript' src='http://MY-SITE.COM/wordpress/wp-includes/js/tinymce/tiny_mce_config.php?ver=20070225'></script>

    I noticed something else this morning while repeatedly refreshing the Create Post page.

    Sometimes, the visual buttons are redrawn before the other elements on the page. Sometimes they are redrawn last. Most of the times they never appear (unless I shift-refresh). Shift-refresh is slower, but usually (but not always) results in the buttons being visible; sometimes it acts just like a refresh.

    Sometimes the visual buttons are visible immediately after reload, but then they vanish. I click refresh, then the edit box changes to a darker shade of gray, then the buttons disappear and are not redrawn. So, whatever javascript or CSS changes the color of the edit box is executing, but the javascript that’s supposed to add the visual buttons is *not* executing. I haven’t dug through the code to find out which file does what.

    Another thing I noticed: I loaded the Create Post page in 2 tabs (in firefox). I then refreshed until one tab was “good” (with visual buttons) and one was “bad”. The html for both tabs was identical except for temp_ID and hh/mm/ss data; this makes sense. None of the javascript includes differed between the “good” and “bad” tabs. So, unless those temporary and time values are making php behave fundamentally differently or the deviations are caused by javascript not running the same each time. I’m thinking the latter.

    I did a side-by-side comparison of the “bad” page and “good” page using firefox’s DOM inspector. Here’s what I found:

    1) The “good” page has 2 extra elements at the very end of the body tag:

    <div id="mc_menu_0" class="mceMenu">...</div>
    <div id="mc_menu_1" class="mceMenu">...</div>

    2) The “good” page has an extra span inside of the last div within #postdivrich:

    <span id="mce_editor_0_parent" class="mceEditorContainer">...</span>

    There might be other differences, but those are the two ones I noticed.

    I guess the next steps are to find out:

    1) which javascript is response for adding these elements
    2) why that javascript is not getting executed for the “bad” page

    Okay, I found the code for adding the mce elements. It’s in wp-includes/js/tinymce/tiny_mce.js. That’s a huge file, with huge functions, and prototyping, which I’ve never used. I think we’ll need someone familiar w/ prototyping if we’re going to try to debug it.

    In case you are wondering, WordPress 2.1.3 does not fix the problem. I get the same disappearing visual buttons after upgrading.

    tripecac: Have you checked your site for any other javascript files, as part of plugins or perhaps as part of your theme?

    This is not a WordPress problem, per se. See, WordPress 2.1 started including the scriptaculous scripts as part of the default package. But a lot of older plugins and themes also included versions of these scripts, since older versions of wordpress did not have them. These differing versions interfere with one another, and one of the pretty common occurrences are the problems you are describing.

    Disable your plugins. Look for extra javascript code in the site. Remove it. The problem will go away only when you do this sort of thing.

    In my case, Theme Switcher (http://386a.net/wordpress/theme-switcher/) messed things up.

    Hi, thanks for the info!

    Something weird just happened. When I started up Firefox (with the same tabs as last time, which was a week or so ago), my “Create New Post” page was missing the visual buttons and had javascript errors. This itself wasn’t surprising. Here’s the interesting bit:

    After reading the responses to this topic, I decided to check my Firefox Ad-Ons. I ran the updater and saw that there is a new version of NoScript. I updated NoScript (to 1.1.4.7) and restared Firefox…

    …and now, the visual buttons are always there. I refreshed 20+ times and they never disappeared. Weird. So maybe NoScript was interfering with the loading of MCE javascript (even though I wasn’t blocking it)? Or maybe my browser is just having a “lucky streak”…

    I’ll restart Firefox and try again to see if I can get the MCE buttons to disappear. Unless you hear back from me today, you can assume that I wasn’t able to reproduce the problem anymore.

    Even if I have 100% success today, I’ll post another update again here in a few days to let you know if the success rate is still 100%. If so, then maybe the problem was NoScript. Maybe. I’ll keep you posted!

    Moderator Andrew Ozz

    @azaozz

    WordPress Dev

    tripecac, you’re right… It was after all FF’s NoScript fault. I had to keep refreshing the page too to get tinyMCE back. Changelog from NoScript’s site:

    v 1.1.4.6.070409
    ==========================================================
    x Fixed weird intermittent interference with dynamic JavaScript
      inclusion via document.write() used by some JavaScript libraries
      (e.g. Prototype, Dojo or Tiny-MCE)

    For me, ImageManager was the conflictual plugin. Desactivating all my plugins brings back the TinyMCE editor. I don’t quite understand though cause I started using ImageManager et Wp-Lightbox together and all was working fine. Now I get the same error as you guys as far as I keep IM activated.

    I just updated NoScript to 1.1.4.7 on another PC and the MCE buttons are working there too. Yay! So, problem solved (hopefully!)

    For me, I am having this problem ALL of a sudden.

    I tried FireFox, Safari, IE on Mac and Windows and it does not go away.

    Even when I deactivate all of my plugins, the problem still exists.

    I have a friends blog that I can use fine and get the rich editor.

    Here is what I have determined:

    1. The tiny mice javascript is not referenced in my files and is in my friends
    2. This <fieldset id=”postdivrich”> is also missing in mine

    I totally deleted all of the files and reposted my blog and the problem still exists.

    Anyone have any ideas??

    Mike

Viewing 15 replies - 1 through 15 (of 49 total)
  • The topic ‘realTinyMCE is not defined’ is closed to new replies.
Skip to toolbar