tags:

views:

12

answers:

0

This works in IE, but in firefox it's very strange:

If open it normally if firefox, the designmode doesn't work but if i put a breakpoint on

this.editor.contentWindow.document.designMode = "On";

line, and then release it (after it breaks on it), the designmode works!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <title>Untitled Document</title>
        <script type="text/javascript">



TheEditor = function() {  
    this.editor = null;
    this.mainDiv=document.getElementById("mainDiv"); 
}

TheEditor.prototype = {

      InitializeEditor: function() {


        this.editor=document.createElement('iframe');
        this.editor.frameBorder=1;
        this.editor.width = "500px";
        this.editor.height="250px";       

        this.mainDiv.appendChild(this.editor);

        this.editor.contentWindow.document.designMode = "On";       
    }     


}
            window.onload = function(){
                obj = new TheEditor;
                obj. InitializeEditor();
            }
        </script>
    </head>
    <body>
       <div id="mainDiv">
    </div>
    </body>
</html>