Can't change body background by calling setHTML()

  •  06-08-2007, 6:45 PM

    Can't change body background by calling setHTML()

    Hi,
     
    It is a critical issue for us because we have many functions to set contents to the editor from client-side. They were working in version 5.3 very well, but not in version 6.0.
     
    It is easy to reproduce. The following is the description of the issue:
     
    1. editor1.EditCompleteDocument = true to allow the editor to show body tag;
     
    2. Paste the following html code into the editor:
     
    <html>
         <head>
          </head>
        <body style="background-color: #3366ff">
            <p>Old Content</p>
        </body>
    </html>
     
    3. In WYSIWYG view, call the following function to set a new content to the editor to replace the old one.
     
    editor1.setHTML("<html><head></head><body><p>New Content</p></body></html>");
    or
    editor1.setHTML("<html><head></head><body style=\"background-color: #ffffff\"><p>New Content</p></body></html>");
     
    4. The result is the text has been changed to "New Content", but it still has the old background color in the body tag.
     
    5. It also happens when body tag has background-image;
     
    I found the standard "Page Properties" diaglog has no problem to change body background. Is there any way to set html content in client-side other than calling setHTML()?
     
    Thanks.
     
     
View Complete Thread