안규 공부방

ACTIVE SERVER PAGE > ckeditor - 내용 추가방법 (InsertHTML, setHtml, getDate)

등록일 : 2017-07-04 14:55 조회수 : 93,283


 function InsertHTML(txt)
{
// 원하는 에디터의 인스턴스를 가져온다. (board_contents 는 객체이름을 넣는다)
var oEditor = CKEDITOR.instances.board_contents

// Check the active editing mode.
if ( oEditor.mode == 'wysiwyg' )
{
// Insert the desired HTML.
oEditor.insertHtml( txt );
return true;
}
else
alert( '위지윅 모드여야 가능합니다!' );
return false;
}



기존 내용에 컨텐츠를 추가할 때는 아래처럼,
oEditor.insertHtml(txt)  

기존 내용에 컨텐츠를 삭제하고 추가할 때는 아래처럼,
oEditor.setData(txt);

기존 내용을 가져올때는 아래처럼
oEditor.getData(txt);

 
※ 혹시 도움이 되셨다면 댓글에 한마디 남겨주세요!
작성자   비밀번호
자동글 방지     (자동글 방지 기능입니다.)
내용   댓글달기 
이메일 문의 : cak0280@nate.com  
Copyright 2000 By ENTERSOFT.KR All Rights Reserved.