<textarea name="page[content]" id="content" class="medium-width" style="height:100px;"></textarea>
<script type="text/javascript">
CKEDITOR.replace( 'page[content]' );
$('#btn').click(function(){
CKEDITOR.instances.page[content].updateElement();
});
</script>
我正在使用我的textarea字段的数组名称。它适用于调用CKEDITOR.replace( 'page[content]' );
现在我的问题在这里CKEDITOR.instances.page [content] .updateElement()...这里我如何使用数组字段名称?...
如果我使用普通名字,它运作良好。
我如何在这里使用数组名称CKEDITOR.instances.page[content].updateElement()
?
答案 0 :(得分:1)
您也可以通过它的ID来调用它,请参阅http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.html#.replace
<script type="text/javascript">
CKEDITOR.replace( 'content' );
$('#btn').click(function(){
CKEDITOR.instances.content.updateElement();
});
</script>