When the WYSIWYG Editor is loaded into a page, it builds its menu automatically and gets all functions ready to go. The last thing it does is set up the designMode, which is the area where all WYSIWYG actions take place and the WYSIWYG contents are actually handled by the browser.

So checking if the editor is already loaded is merely checking if the designMode is ready. And better yet, there's no need to know how to reach through a designMode object as the WYSIWYG editor has functions that access it. If you need some action to take place right after the editor is loaded, this JavaScript snippet can help you. It assumes:
  • the editor is instantiated as wysiwyg
  • the maximum number of tries will be 50 - totalTries<50
  • the time between tries will be 200ms - window.setTimeout('tryToSetFocus()', 200)
  • you want to trigger a function called DoSomething() once the editor is available
  • These options gives this script a maximum of 1000ms (50 tries times 200ms each) of wait for the editor to load - after the 1000ms DoSomething will not be triggered.
    var totalTries = 0;
    function tryToSetFocus() {
    	totalTries++;
    	try {
    		wysiwyg.getHTMLContent();
    	} catch (E) {
    		if (totalTries<50) {
    			tryToWrite = window.setTimeout('tryToSetFocus()', 200);
    		}
    		return;
    	}
    	DoSomething();
    }