Topic: Dynamically load tiny_mce.js after window.load
I'm having some trouble dynamically loading the tiny_mce.js file that's normally included via a script tag on the page that you want a TinyMCE editor.
I want to include this file dynamically, *after* the page has loaded. It seems that if this file is loaded after the window.load event has passed, TinyMCE can't work correctly: render() doesn't execute because Event.domLoaded is false (because _pageInit hasn't been called) but the document 'init' event will never happen because the tiny_mce.js source was loaded after the page was loaded.
I have included a small example that shows what I want to do.
In the above example HTML page, I want to be able to click the first link to load TinyMCE after the page has finished loading, and then click the second link to actually start using TinyMCE on the page. You can see that if you click the second link first, you get an error. If you attempt to load TinyMCE first by clicking the first link, you don't get any errors when clicking the second link, but nothing happens because TinyMCE hasn't been properly initialized.