Re: How can I set control to make insert image no width and height tag info?

  •  09-04-2012, 8:37 AM

    Re: How can I set control to make insert image no width and height tag info?

    Hi oksummer,

     

    if you do not need the widht and height property of the img target anymore, please try the example below. the HTMLfilter code will remove the widht/height property for all images.

     

    1. <%@ Page Language="C#" AutoEventWireup="true" %>  
    2.   
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>  
    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></title>  
    8. </head>  
    9. <body>  
    10.     <form id="form1" runat="server">  
    11.         <CE:Editor ID="editor1" runat="server">  
    12.         </CE:Editor>  
    13.     </form>  
    14. </body>  
    15. </html>  
    16.   
    17. <script type="text/javascript">        
    18. function CuteEditor_FilterHTML(editor,code)     
    19. {     
    20.     var editdoc = editor.GetDocument();  
    21.     for(var i=0;i<editdoc.images.length;i++)  
    22.     {  
    23.            editdoc.images.item(i).removeAttribute("width");  
    24.            editdoc.images.item(i).removeAttribute("height");  
    25.     }  
    26.     return code;     
    27. }     
    28. function CuteEditor_FilterCode(editor,code)     
    29. {     
    30.     var editdoc = editor.GetDocument();  
    31.     for(var i=0;i<editdoc.images.length;i++)  
    32.     {  
    33.            editdoc.images.item(i).removeAttribute("width");  
    34.            editdoc.images.item(i).removeAttribute("height");  
    35.     }  
    36.     return code;     
    37. }     
    38. </script>  
    Regards,

     

    Ken 

View Complete Thread