DEXT5 Editor :: setHtmlValueExWithDocType

void setHtmlValueExWithDocType(value, editor_id)

에디터 디자인 영역에 HTML 소스(<DOCTYPE> 태그 포함)를 입력합니다.
(이 함수를 사용하시려면 Editor에 글을 적용할 때 getHtmlValueEx 함수를 사용해야 합니다.)

return value

없음.

parameters

value  에디터 디자인 영역에 설정할 html 소스를 의미합니다.
editor_id  html 소스를 입력할 에디터의 id를 의미합니다.

remarks

에디터를 1개만 생성했을 경우 parameter를 입력하지 않아도 html소스를 입력할 수 있습니다.
예) id가 editor1인 에디터를 생성했을 경우
     DEXT5.setHtmlValueExWithDocType(html_source, 'editor1'), DEXT5.setHtmlValueExWithDocType(html_source)  
     모두 editor1 에디터 디자인 영역에 html 소스를 입력합니다.

에디터를 2개 이상 생성했을 경우 parameter를 반드시 입력해야 합니다.
예) id가 editor1, editor2인 에디터를 생성했을 경우
     DEXT5.setHtmlValueExWithDocType(html_source, 'editor1')  editor1 에디터 디자인 영역에 html 소스를 입력합니다.
     DEXT5.setHtmlValueExWithDocType(html_source, 'editor2')  editor2 에디터 디자인 영역에 html 소스를 입력합니다.

sample code

<!-- ..... 생략 ..... -->

<script type="text/javascript" src="dext5/js/dext5editor.js"></script>	
<script type="text/javascript">

    function dext_editor_loaded_event() {
        var html = '';
        html += '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">';
        html += '<html>';
        html += '<head>';
        html += '<title>DEXT5 Editor</title>';
        html += '<meta content="text/html" charset="utf-8" http-equiv="Content-Type">'; 
        html += '<style type="text/css">';
        html += 'p { line-height:1.2; margin-top:0px; margin-bottom:0px; }';
        html += '</style>';
        html += '</head>';
        html += '<body>';
        html += '<p>Hi, DEXT5 Editor!!</p>';
        html += '</body>';
        html += '</html>';

        // id가 editor1인 에디터 디자인 영역에 html 소스를 입력합니다.  
        DEXT5.setHtmlValueExWithDocType(html, 'editor1');
    }

</script>

<!-- ..... 생략 ..... -->
 
<div style="width:900px;height:550px">  

    <!-- 에디터 생성 -->  
    <script type="text/javascript">
        new Dext5editor('editor1');
    </script>       

</div>

<!-- ..... 생략 ..... -->

</body>
</html>