Re: Facing problem in safari & chrome

  •  02-11-2011, 8:21 PM

    Re: Facing problem in safari & chrome

    Hi sanjay.joshi,
     
    Get this issue because the code try to use method SetHtml before editor load completely.
     
    I suggest you set the text in  method OnInitialized of editor, like below.
     
    function CuteEditor_OnInitialized(editor)
    {
        var editor1=document.getElementById("<%= cuteEditor1.ClientID %>");
        editor1.SetHTML("text");
    }
     
    Or set a timeout
     
    1. <%@ Page Language="C#" %>  
    2.   
    3. <%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>  
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    5. <html xmlns="http://www.w3.org/1999/xhtml">  
    6. <head id="Head1" runat="server">  
    7.     <title>GetPlainText</title>  
    8. </head>  
    9. <body>  
    10.     <form id="form1" runat="server">  
    11.         <CE:Editor ID="cuteEditor1" runat="server">  
    12.         </CE:Editor>  
    13.       
    14.     </form>  
    15. </body>  
    16. </html>  
    17. <script>  
    18. window.onload=function()  
    19. {  
    20.     setTimeout(setText,400);  
    21. }  
    22. function setText()  
    23. {  
    24.      var editor1=document.getElementById("<%= cuteEditor1.ClientID %>");  
    25.      editor1.SetHTML("text");  
    26. }  
    27. //function CuteEditor_OnInitialized(editor)  
    28. //{  
    29. //    var editor1=document.getElementById("<%= cuteEditor1.ClientID %>");  
    30. //    editor1.SetHTML("text");  
    31. //}  
    32.   
    33. </script> 
     
    Regards,
     
    Ken
View Complete Thread