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

[Solved] Javascript source for the RadEditor

1 Answer 159 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Sambasiva
Top achievements
Rank 1
Sambasiva asked on 16 Jun 2008, 05:34 AM
Hi,

I have written all the necessary javascript functions in <script> block of .aspx page, which are working fine when there are placed in <script> block.

When i place the javascript code in a .js file and taking the reference of it in .aspx, the editor is not invoking the javascript functions.

I want to place my js code in a separate js file. Is there anyway to do this?

1 Answer, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 17 Jun 2008, 12:33 PM
Hello Sambasiva,

It depends on how you need to pass a reference to the editor object.
One possibility is such:

1. declare a global variable in your script where all the functions are.
var globalEditor = null;

2. Use this reference in all of your functions:
function doSomethigWIthEditor()
{
      globalEditor.pasteHtml("Hello");
}


3. On your ASPX page set the global variable to point to a RadEditor instance, e.g.
globalEditor = $find("<%= RadEditor.ClientID %>");


Greetings,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
Sambasiva
Top achievements
Rank 1
Answers by
Tervel
Telerik team
Share this question
or