Support forums
in

Error with document selector example in FireFox v32

Last post 10-08-2014, 9:10 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  10-01-2014, 3:00 PM 80434

    Error with document selector example in FireFox v32

    I was testing some document selector code based on CuteEditor v6.7 when I discovered that the code errors in my FireFox v32 but not in Chrome 38.0.2125.24. After discovering the issue, I tried your online document selector code and found it was recieving the same error when attempt to launch the file selector dialog box. Any idea when this will be resolved?

     

    See screenshot 

  •  10-08-2014, 9:10 AM 80439 in reply to 80434

    Re: Error with document selector example in FireFox v32

    Hi,

     

    Please try the new code below, it will work on firefox 32 too.

    1. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>  
    2. <%@ Page Language="C#"%>  
    3. <html>  
    4. <head>  
    5.     <title>ASP.NET WYSIWYG Editor - Use CuteEditor as a document selector</title>  
    6.     <style>  
    7.         body {   
    8.         text-align: center;   
    9.         margin-top:20px  
    10.         }  
    11.         .demo {   
    12.         text-align: left;   
    13.         width: 700px;  
    14.         border:solid 5px #CBCAC6;  
    15.         background-color:#fbfbfb;  
    16.         padding: 30px 30px 50px 30px;   
    17.         font-family:Segoe UI, Arial,Verdana,Helvetica,sans-serif;  
    18.         font-size: 100%;  
    19.         margin: 0 auto;   
    20.         }   
    21.     </style>  
    22. </head>  
    23. <body>  
    24.     <form id="Form1" runat="server">  
    25.         <div class="demo">  
    26.             <h3>  
    27.                 Use CuteEditor as a document selector</h3>  
    28.             <p>  
    29.                 This example demonstrates how to use CuteEditor as a document selector.  
    30.             </p>  
    31.             <br />  
    32.             <asp:TextBox ID="docFld" Width="300" runat="server" />  
    33.             <input type="button" value="Pick a file" onclick="callInsertImage()" id="Change"  
    34.                 runat="server" name="Change">  
    35.             <CE:Editor id="Editor1" runat="server" Width="1" Height="1" AutoConfigure="None"  
    36.                 ShowHtmlMode="False" ShowPreviewMode="False" EnableContextMenu="false" ShowGroupMenuImage="False"  
    37.                 ShowBottomBar="False" BackColor="White" BorderColor="White">  
    38.             </CE:Editor>  
    39.         </div>  
    40.     </form>  
    41.   
    42.     <script language="javascript">   
    43.       
    44.      function callInsertImage()    
    45.     {    
    46.             var editor1 = document.getElementById('<%=Editor1.ClientID%>');  
    47.             var editdoc = editor1.GetDocument();    
    48.             editdoc.body.innerHTML=" ";  
    49.             editor1.ExecCommand('insertdocument');  
    50.             InputURL();  
    51.             document.getElementById("<%=docFld.ClientID%>").focus();   
    52.     }     
    53.       
    54.     function InputURL()  
    55.     {   
    56.         var editor1 = document.getElementById('<%=Editor1.ClientID%>');  
    57.         var editdoc = editor1.GetDocument();    
    58.         var links = editdoc.getElementsByTagName("a");         
    59.         if(links.length>0&&links[links.length-1].href!="")    
    60.         {   document.getElementById("<%=docFld.ClientID%>").value = links[links.length-1].href;         
    61.         }    
    62.         else  
    63.         {  
    64.             setTimeout(InputURL,500);   
    65.         }     
    66.     }        
    67.     </script>  
    68.   
    69. </body>  
    70. </html>  

     

     

    Regards,

     

    Ken 

View as RSS news feed in XML
Powered by Community Server (Commercial Edition), by Telligent Systems