views:

522

answers:

1
<script type="text/javascript" language="javascript" src="/Content/Scripts/jquery-1.3.2.min.js"></script>        
<script type="text/javascript" src="/Content/ckeditor/ckeditor.js"></script>    
<script type="text/javascript" src="/Content/ckeditor/adapders/jquery.js"></script>    
<script type="text/javascript" language="javascript">
    $(function() {
        $('textarea.ckeditor').ckeditor();
    });        
</script>

<textarea class="ckeditor" cols="5" id="Title" name="Title" rows="5">
</textarea>

It all works fine but before loading page it alerts this "Microsoft JScript runtime error: Object doesn't support this property or method"

But it works after the Visual Studio alert, what might be the reason ?

Thanks in advance

+1  A: 

You should put the code to create the CKEditor instance after the textarea element (or on the onload event of the page).

I don't think that this is also part of the problem, but the folder as distributed is named "adapters", not "adapders"

And it works later because the textarea has the class="ckeditor", so that textarea is automatically replaced: http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.html#.replaceClass

AlfonsoML
Hi, thanks for the answer. It is working already but my problem is visual studio complains about the js line while working on local
Barbaros Alp
As I said, if you try to use CKEditor with a textarea that still doesn't exists (as it's the case in your code) then it's clear that it must fail.You should move the script after the textarea (or put it in an onload handler) and remove the "ckeditor" class to avoid problems with the automatic replacement based on class
AlfonsoML