JS Exception: Component returned error code: 0xc1f30001 (Gecko Implementation only)

Last post 01-31-2008, 4:29 AM by Flintstone. 6 replies.
Sort Posts: Previous Next
  •  01-30-2008, 7:43 AM 36640

    JS Exception: Component returned error code: 0xc1f30001 (Gecko Implementation only)

    I am running Cute Editor inside of a hidden div (Similar to your demo except that I wait 3 seconds for it to finish initializing and then use ce.setHTML to add some text). Most of the time the Editor runs great but in certain circumstances I receive the following Javascript exception:
     
    Command 'selectall' Error : Component returned failure code: 0xc1f30001
    (NS_ERROR_NOT_INITIALIZED) [nsIDOMNSHTMLDocument.execCommand]
     
    I assume because there are a bunch of places in the gecko implementation script file marked:
    //TODO: event not found? throw error
     
    One way to trigger this is to show the div, quickly hide it before the Editor is fully initialized and then show it again.
     
    This exception also appears to be thrown more often on pages that use a lot of Javascript. The exception is not thrown on your Demo page but if you quickly show, hide and then show again without giving it time to fully initialize it does mess up the editor.
     
    This is a web app with a large user base so this is a major problem for us. I have optimized all of the gifs which improves load time quite a lot but this appears to be some issue with the initialization script.
     
    Do you have any suggestions?

  •  01-30-2008, 9:20 AM 36643 in reply to 36640

    Re: JS Exception: Component returned error code: 0xc1f30001 (Gecko Implementation only)

  •  01-30-2008, 9:20 AM 36644 in reply to 36640

    Re: JS Exception: Component returned error code: 0xc1f30001 (Gecko Implementation only)

  •  01-31-2008, 2:38 AM 36685 in reply to 36644

    Re: JS Exception: Component returned error code: 0xc1f30001 (Gecko Implementation only)

    Hi Adam
     
    Yes, the same problems exist in Firefox on both links.
     
    The timing of hide and show is very important. If the div is hidden again before the editor is fully initialized then the text area disappears and does not appear again until the page has been refreshed. 
     
    It is strange that there is no error message on your pages but the error message also appears to be linked to Firefox text areas therefore the two appear to be linked.
  •  01-31-2008, 3:58 AM 36688 in reply to 36640

    Re: JS Exception: Component returned error code: 0xc1f30001 (Gecko Implementation only)

    I have now discovered that both of the following commands cause this issue in Firefox so the text area missing until refresh problem is a separate issue:

    ce.setHTML(s); // Produces Error
    ce.ExecCommand('New'); // Produces Error

    I tried Firefox in Safe Mode but the error still occurs.
  •  01-31-2008, 4:05 AM 36689 in reply to 36685

    Re: JS Exception: Component returned error code: 0xc1f30001 (Gecko Implementation only)

    Flintstone:
    Hi Adam
     
    Yes, the same problems exist in Firefox on both links.
     
    The timing of hide and show is very important. If the div is hidden again before the editor is fully initialized then the text area disappears and does not appear again until the page has been refreshed. 
     
    It is strange that there is no error message on your pages but the error message also appears to be linked to Firefox text areas therefore the two appear to be linked.
     
    Flintstone,
     
    Are you sure you can reproduce this problems in the above links?
     
    If so, can you post the screenshot and error messages?
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  01-31-2008, 4:29 AM 36693 in reply to 36689

    Re: JS Exception: Component returned error code: 0xc1f30001 (Gecko Implementation only)

    No, there are two separate issues:
     
    1. The error messages do not appear in the two links BUT if you hide the div when it is not fully initialized and then show it again then the text area is missing ... it does not happen every time though and is fixed only when the page is refreshed.
    2. As for the JS Exception, it is caused by using ce.setHTML("") or ce.ExecCommand('New'). I have found a workaround now that appears to solve the problem ... when encountering an empty string I use ce.setHTML(" ") and then there is no error message, the cool thing is that because you trim spaces from the string the window is clear ... the function is below:
     
    function HTMLFieldSetContent(s)
        {
        var ce=document.getElementById('CE_Editor_ID');
       
        if(s!=undefined&&ce&&ce.IsReady)
            {
            if(s=='')
                ce.setHTML(' ');
            else
                ce.setHTML(s);
            }
        }

    I hope this helps.
View as RSS news feed in XML