Loading the contents of a rich text popup with client side javascript

Last post 05-09-2005, 9:54 PM by sdolier. 2 replies.
Sort Posts: Previous Next
  •  05-09-2005, 1:48 AM 6507

    Loading the contents of a rich text popup with client side javascript

    I have a page with multiple rich text fields and on slower computers it is quite slow opening.
     
    I am trying to work out a way of having div fields to display the contents of the field and a button above the field that opens a popup containing a rich edit control that reads the contents of the div field, allows the user to edit the data, then save the contents back to the div when they click save.
     
    I am having trouble with the javascript in the popup that reads the contents of the div.
     
    I user the following code:
     
    var editor1 = document.getElementById('<%=RichEdit.ClientID%>');
    var editdoc = editor1.GetDocument();
    editdoc.body.innerHTML = window.opener.document.getElementById('<% =Request.QueryString["f"] %>').innerHTML;
     
    That is run in  the onload event. But the editor1.GetDocument does not always exist when the onload event fires.
     
    Is there an event that can be raised when the editor has finished loading?
     
    Does someone have an example of some similar functionality?
  •  05-09-2005, 10:11 AM 6513 in reply to 6507

    Re: Loading the contents of a rich text popup with client side javascript

  •  05-09-2005, 9:54 PM 6545 in reply to 6513

    Re: Loading the contents of a rich text popup with client side javascript

    I have tried that example. The problem is though, that one in about 5 attempts to load the popup on my pc fails.
     
    I get the following error
     

    On my laptop it happens more often.
     
    This is using IE 6 on XP pro
View as RSS news feed in XML