Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Background:</strong></p> <p>For various reasons <code>onload()</code> is not considered the proper approach for loading Javascript, see for example <a href="http://docs.jquery.com/How_jQuery_Works#Launching_Code_on_Document_Ready" rel="nofollow noreferrer">Launching Code on Document Ready</a>, with the most important/noticeable one being that Javascript code isn't run until the page has finished downloading entirely, including images and the like, which might take an eternity therefore (e.g. if an external banner ad server is down etc.).</p> <p>Instead it is recommended to load Javascript as soon as the <a href="http://en.wikipedia.org/wiki/Document_Object_Model" rel="nofollow noreferrer">DOM</a> is ready, but unfortunately there is no cross browser compatible native solution for this, see <a href="https://stackoverflow.com/questions/65434/getting-notified-when-the-page-dom-has-loaded-but-before-window-onload">Getting notified when the page DOM has loaded (but before window.onload)</a>; please note that my entire answer is based upon the most excellent Javascript library <a href="http://jquery.com/" rel="nofollow noreferrer">jQuery</a>, which offers a <a href="http://docs.jquery.com/How_jQuery_Works#Launching_Code_on_Document_Ready" rel="nofollow noreferrer">cross browser solution for this problem</a>, consequently I'd definitely favor the two higher voted answers over the accepted solution myself.</p> <p><strong>Likely cause:</strong></p> <p>Your issue seems to be caused by the opposite behavior though: <a href="http://en.wikipedia.org/wiki/Google_Chrome" rel="nofollow noreferrer">Chrome</a> facilitates the <a href="http://en.wikipedia.org/wiki/Webkit" rel="nofollow noreferrer">WebKit</a> rendering engine, just like <a href="http://en.wikipedia.org/wiki/Safari_%28web_browser%29" rel="nofollow noreferrer">Safari</a>, and for the latter <code>onload()</code> is discussed to behave differently, see section <em>When does onload fire?</em> in <a href="http://www.howtocreate.co.uk/safaribenchmarks.html" rel="nofollow noreferrer">Is Safari faster?</a>. Another description of this problem specific to Chrome can be found in <a href="http://www.google.com/support/forum/p/Chrome/thread?tid=68745d252343dd53&amp;hl=en" rel="nofollow noreferrer">window.onload not working correctly in Chrome</a>, without an explanation though.</p> <p>In conclusion I suspect <code>onload()</code> to fire before the DOM is actually loaded completely, at least concerning the requirements of TinyMCE, which is notoriously fragile regarding issues like this and simply ceases to load.</p> <p><strong>Possible solution:</strong></p> <p>Just facilitating attribute <a href="http://www.w3.org/TR/html401/interact/scripts.html#adef-defer" rel="nofollow noreferrer"><code>defer</code></a> on the <a href="http://www.w3.org/TR/html401/interact/scripts.html#edef-SCRIPT" rel="nofollow noreferrer"><code>script</code></a> tag as outlined in <a href="http://www.google.com/support/forum/p/Chrome/thread?tid=68745d252343dd53&amp;hl=en" rel="nofollow noreferrer">window.onload not working correctly in Chrome</a> is again not cross browser compatible, hence I'd simply go with the widely deployed and proven approach of using the already mentioned <a href="http://docs.jquery.com/How_jQuery_Works#Launching_Code_on_Document_Ready" rel="nofollow noreferrer">jQuery cross browser solution for the <code>onload()</code> problem</a>, which is good practice anyway and should in principle take care of your inverse issue as well.</p> <hr> <p><strong>Update:</strong></p> <p>There are indeed some bugs filed against <a href="https://bugs.webkit.org/" rel="nofollow noreferrer">WebKit</a> which could back my conclusion (no matter whether this behavior actually constitutes a bug or is intentional), see:</p> <ul> <li><a href="https://bugs.webkit.org/show_bug.cgi?id=15505" rel="nofollow noreferrer">onload sometimes fired before all resources are loaded</a></li> <li><a href="https://bugs.webkit.org/show_bug.cgi?id=17761" rel="nofollow noreferrer">window.onload fires before all subresources loaded</a></li> <li><a href="https://bugs.webkit.org/show_bug.cgi?id=18762" rel="nofollow noreferrer">Window.onload is firing before image resources are loaded</a></li> </ul>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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