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

Last post 01-20-2005, 12:10 AM by vtan. 2 replies.
Sort Posts: Previous Next
  •  01-19-2005, 6:30 PM 3582

    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>
      
     
     
  •  01-19-2005, 11:28 PM 3584 in reply to 3582

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

    please don't use the body-onload .

    try this instead .

    Editor1.Attributes["oninitialized"]="test()";
     
    Regards , Terry .
  •  01-20-2005, 12:10 AM 3587 in reply to 3584

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

    Hi Terry,
     
    Your suggestion is working!!!!! 
     
    Thank you very much for that.
     
    Cheers.
View as RSS news feed in XML