SetHTML problem with IE 8

  •  10-26-2009, 6:47 AM

    SetHTML problem with IE 8

    Hi 

    I tried contacting support but have still had no response on this issue.  
     
    This is a problem I am experiencing when using your php editor and the setHTML method.
     
    If I use the following JavaScript with Internet Explorer 8 to insert content into the editor problems occur. The method is
     
         document.getElementById('CE_editor_ID').setHTML(html);
     
    If I start with a blank editor that has the following content already loaded
     
    <html>
        <head>
        </head>
        <body>
        </body>
    </html>
     
    I then fetch the contents from the following URL: http://pmailer2.prefix.co.za/acid_test.html, and insert the content using your described JavaScript method into the Editor.
     
    If I then view the source of the of the editor I would expect it to be:
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Test</title>
    <style type="text/css">
    <!--
    body {
     font-family: Arial, Helvetica, sans-serif;
     font-size: 14px;
    }
    -->
    </style>
    </head>
    <body>
    Here some copy
    </body>
    </html>
     

    But instead its
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <title>Test</title>
            <style type="text/css"> <!-- body { font-family: Arial, Helvetica, sans-serif; font-size: 14px; } --> </style>
        </head>
        <body>
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <html xmlns="
    http://www.w3.org/1999/xhtml">
                <head>
                    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                    <title>Test</title>
                    <style type="text/css">
                    <!--
                    body {
                    font-family: Arial, Helvetica, sans-serif;
                    font-size: 14px;
                    }
                    -->
                    </style>
                </head>
                </bgsound><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ></meta>
                <style type="text/css">
                <!--
                body {
                font-family: Arial, Helvetica, sans-serif;
                font-size: 14px;
                }
                --></style>Here some copy
            </body>
        </html>
     
    A strange thing is that if focus on the HTML view of the editor and do the fetch, the content is fetched correctly. None of these problems occur in Firefox.
     
    Please will you provide me with a fix for this problem
     
    Thanks
    Sam
View Complete Thread