웹마스터 팁
page_full_width">
입력된 내용대로 출력하는 JS 소스코드 생성기
2003.03.25 00:54
머에 쓰는지는 모르겠씁니다.
암튼 보기 드문거네요
미리보기 : http://xscool.cafe24.com/bbs/zboard.php?id=story2&page=1&sn1=&divpage=1&category=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=21
<html>
<head>
<title>HTML-JS 생성기</title>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<style type="text/css">
th,td { font-family: 돋움; font-size: 9pt; }
textarea { font-family: Fixedsys; }
</style>
<script language="javascript">
function generateSource(form) {
var strContent = form.HTML.value;
strContent = strContent.replace(//g, "\");
strContent = strContent.replace(/"/g, """);
strContent = strContent.replace(/(r{0,1})n/g, "nn");
strContent = strContent.replace(/</script>/gi, "</","script>");
var strResult = "<script language=javascript>ndocument.write("n" + strContent + "");n</" + "script>";
form.JSSRC.value = strResult;
return false;
}
function showResult(form, src) {
var wopt = "menubar=yes,toolbar=yes,location=yes,scrollbars=yes,status=yes,resizable=yes";
switch (true) {
case form.size[1].checked: wopt += ",width=640,height=480"; break;
case form.size[2].checked: wopt += ",width=800,height=600"; break;
case form.size[3].checked: wopt += ",width=1024,height=768"; break;
}
winResult = window.open("about:blank","",wopt);
winResult.document.open("text/html", "replace");
switch (src) {
case "html": winResult.document.write(form.HTML.value); break;
case "js": winResult.document.write(form.JSSRC.value); break;
}
winResult.document.close();
return false;
}
</script>
</head>
<body style="margin:0px" onLoad="document.mainform.HTML.focus()">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4" bgColor="lightgrey">
<form name="mainform" onSubmit="return generateSource(this)">
<tr height="20">
<th align="left" colspan="2">▒ HTML-JS 생성기</th>
</tr>
<tr height="10">
<th width="50%">대상 HTML 소스코드</th>
<th width="50%">HTML 출력용 JS 소스코드</th>
</tr>
<tr>
<td width="50%"><textarea name="HTML" style="width:100%;height:100%"></textarea></td>
<td width="50%"><textarea name="JSSRC" readonly style="width:100%;height:100%"></textarea></td>
</tr>
<tr height="20">
<td colspan="2">
<input type="submit" value="JS 소스코드 생성" onClick="this.form.HTML.focus()">
<input type="button" value="HTML 미리보기" onClick="showResult(this.form,'html');this.blur()">
<input type="button" value="JS 실행결과" onClick="showResult(this.form,'js');this.blur()">
결과창 크기:
<input type="radio" name="size" checked>기본
<input type="radio" name="size">640x480
<input type="radio" name="size">800x600
<input type="radio" name="size">1024x768
</td>
</tr>
</form>
</table>
</body>
</html>
암튼 보기 드문거네요
미리보기 : http://xscool.cafe24.com/bbs/zboard.php?id=story2&page=1&sn1=&divpage=1&category=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=21
<html>
<head>
<title>HTML-JS 생성기</title>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<style type="text/css">
th,td { font-family: 돋움; font-size: 9pt; }
textarea { font-family: Fixedsys; }
</style>
<script language="javascript">
function generateSource(form) {
var strContent = form.HTML.value;
strContent = strContent.replace(//g, "\");
strContent = strContent.replace(/"/g, """);
strContent = strContent.replace(/(r{0,1})n/g, "nn");
strContent = strContent.replace(/</script>/gi, "</","script>");
var strResult = "<script language=javascript>ndocument.write("n" + strContent + "");n</" + "script>";
form.JSSRC.value = strResult;
return false;
}
function showResult(form, src) {
var wopt = "menubar=yes,toolbar=yes,location=yes,scrollbars=yes,status=yes,resizable=yes";
switch (true) {
case form.size[1].checked: wopt += ",width=640,height=480"; break;
case form.size[2].checked: wopt += ",width=800,height=600"; break;
case form.size[3].checked: wopt += ",width=1024,height=768"; break;
}
winResult = window.open("about:blank","",wopt);
winResult.document.open("text/html", "replace");
switch (src) {
case "html": winResult.document.write(form.HTML.value); break;
case "js": winResult.document.write(form.JSSRC.value); break;
}
winResult.document.close();
return false;
}
</script>
</head>
<body style="margin:0px" onLoad="document.mainform.HTML.focus()">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4" bgColor="lightgrey">
<form name="mainform" onSubmit="return generateSource(this)">
<tr height="20">
<th align="left" colspan="2">▒ HTML-JS 생성기</th>
</tr>
<tr height="10">
<th width="50%">대상 HTML 소스코드</th>
<th width="50%">HTML 출력용 JS 소스코드</th>
</tr>
<tr>
<td width="50%"><textarea name="HTML" style="width:100%;height:100%"></textarea></td>
<td width="50%"><textarea name="JSSRC" readonly style="width:100%;height:100%"></textarea></td>
</tr>
<tr height="20">
<td colspan="2">
<input type="submit" value="JS 소스코드 생성" onClick="this.form.HTML.focus()">
<input type="button" value="HTML 미리보기" onClick="showResult(this.form,'html');this.blur()">
<input type="button" value="JS 실행결과" onClick="showResult(this.form,'js');this.blur()">
결과창 크기:
<input type="radio" name="size" checked>기본
<input type="radio" name="size">640x480
<input type="radio" name="size">800x600
<input type="radio" name="size">1024x768
</td>
</tr>
</form>
</table>
</body>
</html>
제목 | 글쓴이 | 날짜 |
---|---|---|
MySQL 5.0 이상 버전에서 Myadmin 접근시 문제 해결 [6] | 니케 | 2007.03.16 |
윈도우즈 Apache 2.0 + PHP 4.4 + MySQL 5.0 설치하기 [16] | 니케 | 2007.02.10 |
진하오 php서버 v1.0 정식공개 합니다. (윈도우스용) | 좋은남자 | 2006.09.13 |
ZEROBOARD 5 세팅을 위한 리눅스 서버 APM 설치 (2006년 8월 7일버젼) [5] | 김기윤761 | 2006.08.07 |
Windows 초간단 remote 백업 명령 | 최길호 | 2006.07.14 |
단 한 줄의 명령어만 실행하여 리눅스에서 apm 설치하기 | gonom | 2006.04.14 |
apache + php + mysql + libxml (리눅스 초간단 설치) [2] | gonom | 2006.04.11 |
/var/log/secure 로그를 이용한 IP Deny 자동 등록 스크립트 | Jini | 2006.02.02 |
Message 탭 (servu4.0) | 이성헌 | 2005.12.15 |
IP access (servu4.0) | 이성헌 | 2005.12.15 |
링크설정 - mapping과 유사 (for anonymous) | 이성헌 | 2005.12.15 |
client anonymous 접속시 비번 물어볼때 (servu4.0) | 이성헌 | 2005.12.15 |
가상 디렉토리 맵핑 (servu4.0) | 이성헌 | 2005.12.15 |
새로운 도메인 설정 (servu4.0) [1] | 이성헌 | 2005.12.15 |
Activity -> user - 접속차단 위주로 설명 (servu4.0) | 이성헌 | 2005.12.15 |
FTP 서버셋팅 (servu4.0) | 이성헌 | 2005.12.15 |
Stop server (servu4.0) | 이성헌 | 2005.12.15 |
FTP 서버 등록정보 | 이성헌 | 2005.12.15 |
Setup Wizard 를 이용한 FTP 서버 설정 (servu4.0) [1] | 이성헌 | 2005.12.15 |
ftp 4.0 Mapping 설정 - 요약 | 이성헌 | 2005.12.15 |
노프레임에서 메뉴들을 js로 생성해놓으면 수정 첨가시 이넘만 고치면 되거든요..^^
불러올땐 <script language="JavaScript" src="js 파일주소"></script>
정말 고맙습니다.