This is a migrated thread and some comments may be shown as answers.

RadEditor EditorTool InsertCustomImage IE9 Problem with JavaScript

3 Answers 60 Views
Editor
This is a migrated thread and some comments may be shown as answers.
SLADS
Top achievements
Rank 1
SLADS asked on 28 Mar 2012, 04:05 AM

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

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 30 Mar 2012, 11:30 AM
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.
0
Phil
Top achievements
Rank 1
answered on 01 Jun 2012, 04:59 PM

Hi Rumen,

 I have the same issue. 

0
Rumen
Telerik team
answered on 05 Jun 2012, 02:19 PM
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.
Tags
Editor
Asked by
SLADS
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Phil
Top achievements
Rank 1
Share this question
or