Child Window - "Object doesn't support this property or method"

  •  01-19-2005, 6:30 PM

    Child Window - "Object doesn't support this property or method"

    Hi,

    I am trying to open a pop up child window with CuteEditor in it. If the IE browser temporary files is cleared, the child window can be open without problem for the first time. But if the child window is closed and then reopen again, CuteEditor will crash with the error message "Object doesn't support this property or method". 

    In addition, CuteEditor works fine if it is in the parent window. Problem only occur if it is in a child window opened by "showModalDialog" method.

    Any help will be really appreciated.

    Thanks.

    Please find following the codes, some codes were copied from this forum to ensure no syntax error. It crashes at the line "var editdoc = editor1.GetDocument();" when child window is open on the second time.

    ------------------------
    Codes for parent window (ParentWindow.aspx):

    <HTML>
     <HEAD>
      <title>ParentWindow</title>
     
      <script language="javascript">
      function OpenEditor()
      {
       var retVal=window.showModalDialog('ChildWindow.aspx', '', 'dialogHeight:600px;dialogWidth:800px;resizable:yes;status:no;help:no;');
      }  
      
      </script>
     </HEAD>
     <body>
      <input type="button" id="btnOpen" value="Open Editor" onclick="OpenEditor();">
     </body>
    </HTML>


    Codes for child window (ChildWindow.aspx):

    <HTML>
     <HEAD>
      <title>Test Cute Editor</title>
     </HEAD>
     <script>
     function test () {
      var editor1=document.getElementById('<%=Editor1.ClientID%>');
      var editdoc = editor1.GetDocument();
      editdoc.onclick=helloworld;
     }
     function helloworld() {
      alert("hello world");
     }
     </script>
     <body onload="test()">
      <form id="Form1" method="post" runat="server">
       <CE:Editor id="Editor1" runat="server"></CE:Editor>
      </form>
     </body>
    </HTML>
      
     
     
View Complete Thread