javaScript Exception in FF - NS_ERROR_DOM_BAD_URI

Rate It (1)

Last post 07-11-2006 6:54 PM by steve harman. 2 replies.

Sort Posts:

  • javaScript Exception in FF - NS_ERROR_DOM_BAD_URI

    07-10-2006, 12:03 AM
    • Member
      128 point Member
    • steve harman
    • Member since 07-09-2006, 11:32 PM
    • Posts 38
    My situation is a pretty simple one. I've got a page with a single UpdatePanel with a Trigger and ContentTemplate as follows:

    <atlas:ScriptManager runat="server" ID="scriptMgr" EnablePartialRendering="true" />
    ....
    <atlas:UpdatePanel id="uppnlClearContent" runat="server" Mode="Conditional">
        <Triggers>
            <atlas:ControlEventTrigger ControlID="btnClearContent" EventName="Click" />
        </Triggers>
        <ContentTemplate>
            <asp:Panel id="pnlClearContent" runat="server"></asp:Panel>
            <p><asp:CheckBox id="chkClearContent" runat="server" Text="Clear Content." Checked="false" /></p>
            <p><asp:Button id="btnClearContent" runat="server" Text="Clear It!" CausesValidation="false" OnClick="btnClearContent_Click"/></p>
        </ContentTemplate>
    </atlas:UpdatePanel>


    I have some processing (very basic logic) happening on the backend and then messages are returned and displayed via the Panel control... and all works well in IE. Actually, it works great in FF for the first click (request), but any subsequent clicks never trigger the AJAX call b/c a javaScript exception is being thrown in (I assume) the callback handler from the first click. I need to refresh/reload the page in order to kick off another request... kind of defeats the purpose of AJAX, huh?

    Using the FireFox javaScript Console, I see the following exception being thrown after clicking the btnClearContent button:
    Error: [Exception... "Access to restricted URI denied"  code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)"

    and the offending line of code is the for loop below:

    this._updateStyleSheet = function(cssText) {
            var head = document.getElementsByTagName('HEAD')[0];
            var styles = document.styleSheets;
            var styleSheet = styles[styles.length - 1];

            if (Sys.Runtime.get_hostType() == Sys.HostType.InternetExplorer) {
                styleSheet.cssText = cssText;
            }
            else {              
                for (var i = styleSheet.cssRules.length - 1; i >= 0; i--) {
                    styleSheet.deleteRule(i);
                }

    My Venkman debugger is acting odd so I can't dig into this anymore. Is anyone else seeing this?
  • Re: javaScript Exception in FF - NS_ERROR_DOM_BAD_URI

    07-10-2006, 7:17 AM
    • Member
      128 point Member
    • steve harman
    • Member since 07-09-2006, 11:32 PM
    • Posts 38
    Some other details I forgot to mention:
    - I'm running Firefox 1.5.0.4
    - You can reproduce this issue by going to the Atlas Docs examples... like this one.

    To recreate:
    1. Open that link.
    2. In FF go to Tools -> JavaScript Console, and click the "Clear" option at the top of the JavaScript Console window.
    3. Now, in the window that the example is in, click the first button.
    4. Look at the JavaScript Console. You should see the exception message.
  • Re: javaScript Exception in FF - NS_ERROR_DOM_BAD_URI

    07-11-2006, 6:54 PM
    • Member
      128 point Member
    • steve harman
    • Member since 07-09-2006, 11:32 PM
    • Posts 38
    Sounds like the Atlas team has been made aware of this issue... hopefully a fix will be available soon.
Page 1 of 1 (3 items)