fOnAppLoad 에서
oEditors.getById["textarea ID"].exec("PASTE_HTML",[들어갈 변수]);
들어갈 변수에 값을 console.log로 찍어보면 <p> <<-- 이렇게 치환된 값이 들어가 있으면
textarea 안에 태그가 제대로 적용되지 않고 문자열로 인식이 된다.
그래서 치환을 해줘야 한다.
String.prototype.decodeEntity = function() {
return this.replace(/&/gi, "&").replace(/</gi, "<").replace(/>/gi, ">");
};
공통으로 치환해주는 prototype 만들어서 사용하면 편리합니다.
var contentText = '<p>ervtwertfver</p><p><br></p><p><br>';
contentText = contentText.decodeEntity();
oEditors.getById["textarea ID"].exec("PASTE_HTML",[contentText ]);