TinyMCE draws well but won't let me type it in. In FF buttons with error: Component return code: 0x80004005

In previous apps, I was able to get TinyMCE to work fine. But in this web application, I get a rich editor to keep everything in order, but for some reason I cannot type in the rich editor box, and when I click the button, as if for boldness, I get this error:

Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: http://mysite/tiny_mce/tiny_mce.js :: anonymous :: line 1"  data: no]
Source File: http://mysite/tiny_mce/tiny_mce.js
Line: 1

      

I would like to know what I can do to debug what is happening here. What could be causing this strange error?

Some background:

This code loads TinyMCE:

<script type="text/javascript" src="http://mysite/tiny_mce/tiny_mce.js"></script> 
<script>
tinyMCE.init({
    mode : 'none',
    editor_selector: 'mceAdvanced',
    theme : 'advanced',
    theme_advanced_toolbar_location : 'top',
    theme_advanced_toolbar_align : 'left',
    theme_advanced_buttons1 : 'fontsizeselect,bold,italic,|,bullist,numlist,|,outdent,indent,|,removeformat',
    theme_advanced_buttons2: '',
    theme_advanced_buttons3: '',
    theme_advanced_font_sizes: "1, 2, 3, 4",
    width: '600',
    height: '200',
    remove_script_host : true,
    cleanup_on_startup : true,
    cleanup: true,
    debug : true,
    convert_urls : false
});

tinyMCE.execCommand('mceAddControl', true, 'fldOverview');
</script>

<textarea id="fldOverview" name="fldOverview" class="textbox"><?= OVERVIEW ?></textarea>

      

Tested:

Error FF3. Opera (last stable) is working. Windows IE7 works. Safari (latest stable) works.

+1


source to share


2 answers


The answer is here .

The deal is as follows. Have you ever used Facebook? We tried to implement a similar interface, when you click to edit a profile section, it collapses and re-expands with a progress bar, then collapses and re-expands using a profile form. In this profile form, we had the rich editor TinyMCE.



Well, it turns out that the quirk with DIVs is hidden and then shown to show the TinyMCE control. Is this time off or something else? Anyway, we used the slideToggle API in jQuery to fold and re-expand the DIV with new content that we pulled out with jQuery AJAX. And when we did, somehow this slideToggle API called us.

The fix should be to make slideToggle like we usually do, but before loading the tinyMCE editor using the execCommand method, we need to use the show API in jQuery to ensure that our DIV is forced to be open and visible, first. When we did that, the problem went away.

+4


source


Are you doing this in Firefox?

Because according to this , it appears when you disable popups in firefox due to the popup blocker implemented.



Enable pop-ups and you're good to go!

0


source







All Articles