웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
자바 스크립트 소스 올릴때 예제 쉽게 보이기
2003.03.12 20:55
제목이 맞게 됐는지 모르겠네요
제가 글 솜씨가 없어서
그냥 예제 보시면 이해 되실듯....
미리보기 : http://xscool.cafe24.com/bbs/zboard.php?id=story2&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=18
-------------------- 아래가 소스 입니다 ------------------------
<script language="javascript">
function showPreview(pvObj)
{var wname = "preview";
var wopt = "menubar=yes,scrollbars=yes,status=yes,resizable=yes,width=640,height=480";
winResult = window.open("about:blank",wname,wopt);
winResult.document.open("text/html", "replace");
winResult.document.write(pvObj.value);
winResult.document.close();
return false;}
</script>
<table width="508" border="0" style="table-layout:fixed">
<form name="previewform" onSubmit="return false">
<tr><td width="502" height="420">
<input type="button" class="button" value="미리보기" onClick="return showPreview(this.form.exsrc)" style="color:black; background-color:rgb(204,153,0);"><br>
<textarea name="exsrc" class="entry" rows="25" style="border-color:rgb(204,153,0); border-style:solid; width:100%;" cols="68">
★이부분에 소스를 적어 줍니다.★
</textarea>
</td></tr>
</form>
</table>
-------------------- 요기 까지 ------------------------
제가 글 솜씨가 없어서
그냥 예제 보시면 이해 되실듯....
미리보기 : http://xscool.cafe24.com/bbs/zboard.php?id=story2&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=18
-------------------- 아래가 소스 입니다 ------------------------
<script language="javascript">
function showPreview(pvObj)
{var wname = "preview";
var wopt = "menubar=yes,scrollbars=yes,status=yes,resizable=yes,width=640,height=480";
winResult = window.open("about:blank",wname,wopt);
winResult.document.open("text/html", "replace");
winResult.document.write(pvObj.value);
winResult.document.close();
return false;}
</script>
<table width="508" border="0" style="table-layout:fixed">
<form name="previewform" onSubmit="return false">
<tr><td width="502" height="420">
<input type="button" class="button" value="미리보기" onClick="return showPreview(this.form.exsrc)" style="color:black; background-color:rgb(204,153,0);"><br>
<textarea name="exsrc" class="entry" rows="25" style="border-color:rgb(204,153,0); border-style:solid; width:100%;" cols="68">
★이부분에 소스를 적어 줍니다.★
</textarea>
</td></tr>
</form>
</table>
-------------------- 요기 까지 ------------------------
댓글 2
-
TheMics
2003.03.13 16:43
이왕이면 readonly를 넣는것이 좋지 않을까요; -
RedEye
2003.04.14 12:19
이 방법을 게시판에서 글쓸때 따로 소스로 쓰는 textarea를 하나 더 만들어 본문에 textarea 로뿌려주는 팁용으로 쓴다면 더 좋겠지요..