RadEditor EditorTool InsertCustomImage IE9 Problem with JavaScript

4 posts, 0 answers
  1. SLADS
    SLADS avatar
    3 posts
    Member since:
    Jun 2012

    Posted 27 Mar 2012 Link to this post

    Hi Everyone,

    I am using RadEditor, and I am trying to create an insert/upload image dialog. It works great in FF, Chrome, IE7/8 and before, but in IE9 it throws JavaScript error

    “Line: 792

    Error: DOM Exception: INVALID_CHARACTER_ERR (5)”  

    Built in debugger is throwing error at

    }}else{var o=($telerik.isIE)?document.createElement("<iframe name='"+c+"'>"):document.createElement("iframe");

    o.name=c;

     

    And console is showing:

    SCRIPT5022: DOM Exception: INVALID_CHARACTER_ERR (5)
    ScriptResource.axd?d=rJkSr8ttpP52D876ZF1WeNxnHE6aTSXEyuHB1Xl6uJ1zBgTteHkHuv7Y2iAt9aZv9uah5nKxT6ylXPwwQHwgyljpNIHN3Q0-kSVosKQoQ2uPIfQme2LiD3_reNMfI8mZGncmOhVbL4j51EIh2kStPmT25r81&t=ffffffff987f999b, line 792 character 8

    This is JavaScript used

    <script type="text/javascript">

                    Telerik.Web.UI.Editor.CommandList["InsertCustomImage"] = function(commandName, editor, args) {

                        var myCallbackFunction = function(sender, args) {

                            editor.pasteHtml(String.format("<img src='{0}' border='0' align='middle' alt='Custom Image' /> ", args.image));

                        }

                        editor.showExternalDialog(

                                            "UploadEmailImage.aspx",

                                            {},

                                            400,

                                            310,

                                            myCallbackFunction,

                                            null,

                                            "Insert Image",

                                            true,

                                            Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,

                                            false,

                                            true);

                    };

               </script>

    And aspx is:

    <telerik:RadEditor ID="txtEmailMessage" runat="server" Width="99%" Height="300px">

                                        <Tools>

                                            <telerik:EditorToolGroup>

                                                <telerik:EditorTool Name="InsertCustomImage" Text="Insert Image" />

                                            </telerik:EditorToolGroup>

                                        </Tools>

                                    </telerik:RadEditor>

    Any help welcome

    If you need anything else, please ask. 

    Cheers

    S

  2. Rumen
    Admin
    Rumen avatar
    14421 posts

    Posted 30 Mar 2012 Link to this post

    Hi,

    For your convenience I prepared and attached here a sample working project with RadEditor and a custom Upload and Insert Image dialog. Please, test it and use it as a base to implement your scenario. It works in IE, Firefox and WebKit.

    All the best,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Phil
    Phil avatar
    5 posts
    Member since:
    Oct 2011

    Posted 01 Jun 2012 Link to this post

    Hi Rumen,

     I have the same issue. 

  4. Rumen
    Admin
    Rumen avatar
    14421 posts

    Posted 05 Jun 2012 Link to this post

    Hello,

    Are you able to reproduce the problem with the provided in my earlier response sample project? If yes, could you please provide steps and screenshots/video demonstrating how to reproduce it on my end?

    Kind regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top