Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you are using <code>jquery.tinymce.js</code> then you don't need <code>tiny_mce.js</code> because TinyMCE will try to load it with an ajax request. If you are finding that <code>window.tinymce</code> (or simply <code>tinymce</code>) is <code>undefined</code> then this means that the ajax is not yet complete (which might explain why using <code>setTimeout</code> worked for you). This is the typical order of events:</p> <ol> <li>Load <code>jquery.js</code> with a script tag (or google load).</li> <li>Load TinyMCE's jQuery plugin, <code>jquery.tinymce.js</code>, with a script tag.</li> <li><p>Document ready event fires; this is where you call <code>.tinymce(settings)</code> on your <code>textarea</code>s. E.g. <code>$('textarea').tinymce({ script_url: '/tiny_mce/tiny_mce.js' })</code></p></li> <li><p>Load <code>tiny_mce.js</code> this step is done for you by TinyMCE's jQuery plugin, but it could happen after the document ready event fires.</p></li> </ol> <p>Sometimes you might really need to access <code>window.tinymce</code>, here's the safest way to do it:</p> <p> $(document).tinymce({ 'script_url': '/tiny_mce/tiny_mce.js' 'setup': function() { alert(tinymce); } });</p> <p>TinyMCE will go so far as to create a <code>tinymce.Editor</code> object and execute the setup callback. None of the editor's events are triggered and the editor object created for the document is not added to <code>tinymce.editors</code>.</p> <p>I also found that TinyMCE's ajax call was interfering with my <code>.ajaxStop</code> functions so I also used a <code>setTimeout</code>:</p> <p> $(document).tinymce({ 'script_url': '/tiny_mce/tiny_mce.js' 'setup': function() { setTimeout(function () { $(document).ajaxStart(function(e) {/* stuff <em>/}); $(document).ajaxStop(function(e) {/</em> stuff */}); }, 0); } });</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload