위지윅 모드로 편집하는 편집기를 만들기 위해서는 iframe을 이용해서 하는 방법을 이용하게 된다.
iframe의 designMode 속성을 'on'으로 지정하면 편집모드로 설정될 수 있다.
iframe의 designMode 속성을 'on'으로 지정하면 편집모드로 설정될 수 있다.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<script type="text/javascript">
window.onload = function ()
{
var eBox = document.getElementById("EditBox");
eBox.contentWindow.document.designMode = "on";
eBox.frameBorder = 0;
eBox.border = 0;
eBox.height = "400px";
eBox.width = "300px";
}
</script>
</HEAD><BODY>
<iframe id="EditBox" href="about:blank"></iframe>
</BODY>
</HTML>
'Development > JavaScript' 카테고리의 다른 글
| Window size and scrolling (0) | 2007.09.18 |
|---|---|
| TreeView 형태의 자바스크립트 코드 (0) | 2007.08.31 |
| HTTP Cookie Javascript (0) | 2007.08.23 |
| Ajax 호출의 일반적인 패턴 (0) | 2007.08.21 |
| ASP.NET에서 사용할 정말 편한 Ajax Library (2) | 2007.08.18 |