我想在前台做验证
但net版本是不需要进行注册就可以用的
也就是说不存在var editor = CKEDITOR.replace('txtDesc');,类似于直接在textBox设定样式class="ckeditor"所以这时候也就不存在editor.document.getBody().getText(),或者有什么办法找出这个editor来我用CKEDITOR.instances.content.getData() 就直接在浏览器报错
错误: 'CKEDITOR.instances.content' 为空或不是对象
我应该怎么样做验证?我用的是ckeditor_aspnet_3.5.3版本,JQuery是1.5版本
开发环境是VS2008 sp1

解决方案 »

  1.   

    官方网站上面应该有例子的,
    How Do I Read or Write the Contents of CKEditor from JavaScript?If you want to read CKEditor contents, use the getData() method. CKEDITOR.instances.editor1.getData() If you want to write some content into CKEditor, use the setData(data, callback) method. An example of how to use these functions can be found in the Basic usage of the API sample (api.html) located in the _samples directory of CKEditor installation package. 文档地址
    http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#getData
    http://docs.cksource.com/CKEditor_3.x/Howto/Reading_Editor_Contentsjquery集成
    http://docs.cksource.com/CKEditor_3.x/Developers_Guide/jQuery_Adapter