sub_title
 Javascript
제   목 [Document] 태그연습장
작성자 오렌지 등록일 2007-11-21 01:10:12 조회수 7,046

<!--소스시작-->
<SCRIPT LANGUAGE="JavaScript">
function hellothere()  {
 open("
http://www.cyborg21.com/forum/help.html" , "WZUP" , "width=300,height=400");
}

function AppendText(str) {
        document.forms[0].TEXT.value += str;
        return;
}


function EditAppendText(form, type) {
        strin =  "form." + type + ".options[(form." + type + ".selectedIndex)].value";
        form.TEXT.value += eval(strin);
        return;
}


function ViewPage(form) {
 
msg=open("","DisplayWindow","toolbar=no,directories=no,menubar=yes,width=500,height=500");

msg.document.write(form.TEXT.value);
//msg.document.write('<form><input type="BUTTON" value="소스저장하기" onClick="window.location = "view-source:" + //window.location.href"></form>');
     

       

 
}

function MakePage(form) {
    
form.TEXT.value="<html>\n"+"<head><title>히히</title></head>\n"+"<body>\n"+"\n"+"\n"+"\n"+"\n"+"<--이곳에소스를-->\n"+"</body>\n"+"</html>";

        return;

       
       

 
}

 

function ClearText(form) {
        form.TEXT.value="";
        return;
}

</SCRIPT>

                
<base target="_self">
<style type="text/css">
input {color:black; font-size: 9pt; background-color:#99ccff; border:1 solid #6699ff;size= 30;height:20px}
textarea {color:black; font-size: 9pt; background-color:white; border:1 solid #6699ff}
</style>
</HEAD>
<BODY background="101background.gif">
<center><div style="width:320; height:50; font-size:30pt;
filter:dropshadow(color=#cccccc, offx=10, offy=10, positive=1)">
태그 연습장</div>
 
<FORM NAME="pMakeForm">
<script language = "JavaScript">

<!-- Hide from older browsers
document.write('<pre><b>도움말 유무 선택:  </b>')

helpon = true    // ...true or false

document.write('<input type="radio" name="radiohelp"  value="true"checked onClick = " helpon = true"> 열기 ')
document.write('<input type="radio" name="radiohelp"  value="false"  onClick = " helpon = false"> 닫기 <br>')

 

document.write('<b>HTML mode선택:    </b>')

modeindex = 0    // ...0=간단형, 1=샘플, 2=복잡형

document.write('<input type="radio" name="radiomode"  value="Copyright 1996  Ray Daly"  onClick = " modeindex = 0 "> Simple ')
document.write('<input type="radio" name="radiomode"  value="Copyright 1996  Ray Daly" onClick = " modeindex = 1"> Sample ')
document.write('<input type="radio" name="radiomode"  value="Copyright 1996  Ray Daly" checked onClick = " modeindex = 2"> Prompt <br></pre>')
document.write('<b>태그버튼</b>')
document.write('<table cellspacing="0" border="0">')
document.write('</th><th><input type="button" value=" H1 " onClick="HjButton(this.form,jH1)">')
document.write('<input type="button" value=" H2 " onClick="HjButton(this.form,jH2)">')
document.write('<input type="button" value=" H3 " onClick="HjButton(this.form,jH3)">  ')
document.write('<input type="button" value=" B " onClick="HjButton(this.form,jBold)">')
document.write('<input type="button" value="  I  " onClick="HjButton(this.form,jItalics)">')
document.write('<input type="button" value=" PRE " onClick="HjButton(this.form,jPre)">  ')
//document.write('</th><th><input type="button" value=" OL " onClick="HjButton(this.form,jOL)">')
//document.write('<input type="button" value=" UL " onClick="HjButton(this.form,jUL)">')
//document.write('<input type="button" value=" LI " onClick="HjButton(this.form,jLI)">  ')
//document.write('</th><th><input type="button" value=" DL " onClick="HjButton(this.form,jDL)">')
//document.write('<input type="button" value=" DT " onClick="HjButton(this.form,jDT)">')
//document.write('<input type="button" value=" DD " onClick="HjButton(this.form,jDD)"><br>')
document.write('<input type="button" value=" P " onClick="HjButton(this.form,jPara)">')
document.write('<input type="button" value=" BR " onClick="HjButton(this.form,jBreak)">')
document.write('<input type="button" value=" HR " onClick="HjButton(this.form,jRule)">  ')
document.write('</th><th><input type="button" value="    링크넣키     " onClick="HjButton(this.form,jAnchor)">  ')
document.write('</th><th><input type="button" value=" 왼쪽" onClick="HjButton(this.form,jImageL)">')
document.write('<input type="button" value=" 이미지 " onClick="HjButton(this.form,jImage)">')
document.write('<input type="button" value="오른쪽" onClick="HjButton(this.form,jImageR)">  ')
document.write('</th><th><input type="button" value="     Center     " onClick="HjButton(this.form,jCenter)">  ')

document.write('</th></tr></table>')

function HjReset (form)  {    // ...required because RESET does not reset values, just GUI

 helpon = false
 modeindex = 0

 form.TEXT.value = ""
 }

function HTMLtag (buttonname, insertmode, inserttext, tagstart, tagmiddle, tagend, sampletext, sampletext2, helptext)  {    // ...this fuction defines the object HTMLtag

 this.buttonname = buttonname
 this.insertmode = insertmode 

 // ...1=none 2=standard input 3=lists (UL and OL) 4=DL list 5=anchor

 this.inserttext = inserttext    // ...prompt when asking for insert text
 this.tagstart   = tagstart
 this.tagmiddle  = tagmiddle
 this.tagend     = tagend
 this.sampletext = sampletext    // ...sample text placed between tags in TextArea
 this.sampletext2= sampletext2
 this.helptext   = helptext
 }

jStart = new HTMLtag ( "Start", "2", "문서의제목을 넣으세요", " <HTML><HEAD><TITLE>", "",               "</TITLE></HEAD><BODY>", "문서의제목입니다 (ex.철이홈)", "" , "문서를 시작하기버튼으로 문서의타이틀을<title>와</title>태그사이에 적어요." )

jEnd = new HTMLtag ( "End", "1", "", " </BODY></HTML>", "", "", "", "" , "이tag는 문서가완료시 넣읍니다." )

jBold = new HTMLtag ( "B", "2", "글씨를 bold체인경우", " <B>", "", "</B>", "<B></B>사이에 글을넣어요", "" , "<B></B>사이의 글자를 넣으면 글이 두껍게 나옵니다" )

jItalics = new HTMLtag ( "I", "2", "이택체를 넣는다", " <I>", "", "</I>", "이것이 이태릭체임", "" , "<I></I>사이에 글을 넣으면 이태릭체가됩니다." )

jPre = new HTMLtag ( "PRE", "2", "<PRE>와</PRE>사이에 글을 넣으면되요", " <PRE>", "", "</PRE>", "This will be PREformatted", "" , "문장이<PRE> 와 </PRE>태그사이에 넣으세요" )

jPara = new HTMLtag ( "P", "2", "PARAGRAPH을 넣는다", " <P>", "", "</P>", "다음PARAGRAPH까지 진행됨.", "" , "문장을 <p>태그로 나눕니다" )

jBreak = new HTMLtag ( "BR", "1", "", " <BR>", "", "", "", "" , "줄 띄우기로 띄울려는 문장뒤에 씁니다." )

jRule = new HTMLtag ( "HR", "1", "", " <hr size=1>", "", "", "", "" , "수평선 긋기." )

jH1 = new HTMLtag ( "H1", "2", "문장의 제목 넣기", " <H1>", "", "</H1>", "문장의 첫제목을 쓸때쓰는태그임 즉 큰글자인경우", "" , "문장의 첫 큰제목을 <H1> 와 </H1>사이에 넣으세요." )

jH2 = new HTMLtag ( "H2", "2", "두번째 제목넣키", " <H2>", "", "</H2>", "2번째소재목으로", "" , "소제목문장을<H2>태그와</H2>태그사이에 넣으면됩니다." )

jH3 = new HTMLtag ( "H3", "2", "필요시 세번째 제목 넣키", " <H3>", "", "</H3>", "3번째소재목으로", "" , "작은제목을 <H3>와</H3>태그사이에 넣어요" )

jCenter = new HTMLtag ( "Center", "2", "가운로 문자배열을 넣을때ㅅ씁니다", " <CENTER>", "", "</CENTER>", "이태그 사용시 글이가운데 위치합니다", "" , "문자를<CENTER>태그와</CENTER>태그사이에넣어요-이태그 사용시 글이가운데 위치합니다." )

jOL = new HTMLtag ( "OL", "3", "넘버 넣키", " <OL><LI> ", "</LI><LI> ", "</LI></OL>", "This is one item in the numbered list", "Next item in the numbered list" , "Create an ORDERED LIST by placing multiple items between <LI> and </LI>" )

jOL.inserttext2 = "Enter NEXT item for ORDERED LIST"

jUL = new HTMLtag ( "UL", "3", "Enter FIRST item for (Plain) UNORDERED LIST", " <UL><LI> ", "</LI><LI> ", "</LI></UL>", "This is one item in the plain list", "Next item in the plain list" , "Create an ORDERED LIST by placing multiple items between <LI> and </LI>" )

jUL.inserttext2 = "Enter NEXT item for UNORDERED LIST"

jLI = new HTMLtag ( "LI", "2", "Enter the text for an item in a LIST", " <LI>", "", "</LI>", "This is an item in a LIST", "" , "The text placed between the <L1> and the </L1> will one item in a LIST.  Requires OL or UL." )

jDL = new HTMLtag ( "UL", "4", "Enter item for DEFINITION LIST", " <DL><DT>", "</DT> <DD>", " </DD></DL>", "Item to be defined", "Definition of the item" , "DEFINITION LISTS have two elements: item and definition.  Enter the item." )

jDL.inserttext2 = "Enter the definition "

jDL.tagmiddle2='</DD> <DT>'

jDT = new HTMLtag ( "DT", "2", "Enter item for a DEFINITION LIST", " <DT>", "", "</DT>", "This is item for a DEFINITION LIST", "" , "The text placed between the <DT> and the </DT> will one item in a LIST.  Requires DL." )

jDD = new HTMLtag ( "DD", "2", "Enter definition for a DEFINITION LIST", " <DD>", "", "</DD>", "This is definition in a DEFINITION LIST", "" , "The text placed between the <DD> and the </DD> will one item in a LIST.  Requires DL." )

jImageL = new HTMLtag ("Image", 2, "Enter the URL (e.g., sample.gif)", ' <IMG SRC="', "", '" ALIGN=LEFT>', "URL to graphic (e.g. sample.gif)" , "", "그림태그로 왼쪽에그림위치시키기-콤마사이에 그림주소를 넣어요" )

jImage = new HTMLtag ("Image", 2, "그림주소를 적어요", ' <IMG SRC="', "", '">', "그림주소를 콤마사이에 넣어요" , "", "그림주소적기" )

jImageR = new HTMLtag ("Image", 2, "Enter the URL (e.g., sample.gif)", ' <IMG SRC="', "", '" ALIGN=RIGHT>', "그림태그로 오른쪽에그림위치시키기-콤마사이에 그림주소를 넣어요" , "", "콤마사이에 그림주소를 넣어요" )

jAnchor = new HTMLtag ("Anchor", 5, "링크시킬주소를 적어요", ' <A HREF="', '"> ', '</A>', "http://www.yahoo.com", "Yahoo 설명적기", "주소적기 (e.g., http://www.cybogr21.com)-주소를 코마사이에 넣으세요-크릭시 이주소로 페이지가이동합니다" )

jAnchor.inserttext2 = "Enter description (e.g., Yahoo)"

function About (form)  {
 alert('HTMLjive 1.2  1996 Ray Daly -
http://www.cris.com/~raydaly/htmljive.html를 제가수정보안햇음!')
 }

function Save (form)  {
 alert('현재 저장기능은 불가능합니다.  작성하신문서는 복사하여 다른곳에 저장하세요.')
}

function HjButton (form,selection)  {    // ...all HTML button call this routine
 if (helpon)  {
  if (confirm(selection.helptext))  {
   addHTML (form,selection)
  }
 }
 else  {
  addHTML (form,selection)
 }
}

function addHTML (form,selection)  {    // ...add text to value ot TextArea
 cancel = false
 addText=selection.tagstart
 if (modeindex==2)  {    // ...insert mode
  if (selection.insertmode != 1 )  {    // ...if none, skip it all
   addText += addHTMLinsert (selection, addText, form)
   if (addText == selection.tagstart)  {
    cancel = true
   }
  }
 }
 if (modeindex==1)  {    // ...sample mode
  addText = addText + selection.sampletext + selection.tagmiddle + selection.sampletext2
 }
 if (modeindex==0)  {    // ...simple mode
  addText += selection.tagmiddle
 }
 addText += selection.tagend
 if (cancel == false)  {    // ...put text into TextArea unless canceled
  form.TEXT.value += addText
 }
}

function addHTMLinsert (selection, addText, form)  {

 // ...insert mode
 // ...addText alread as .tagstart, cancel=false
 // ...insertmodes 1=none, 2=insert, 3=lists (UL and OL), 4=DL list, 5=anchor

 if (selection.insertmode ==2)  {    // ...simple insert (eg.<B>...</B>
  i = ""
  i = prompt (selection.inserttext, "")
  if ((i != null) && (i != ""))  {    // ...if input add
   addText = i
  }
  else  {
   addText = ""
  }
 }

 if (selection.insertmode == 3)  {    // ...UL and OL lists
  addText = ""
  i = ""
  i = prompt (selection.inserttext, "")
  if ((i != null) && (i != ""))  {
   addText = i
   while ((i != null) && (i != ""))  {    // ...get next until null
    i=prompt (selection.inserttext2, "")
    if ((i != null) && (i != ""))  {
     addText=addText + selection.tagmiddle + i
    }
   }
  }
 }

 if (selection.insertmode == 4)  {    // ...DL list
  i= "dummy"
  j = i
  addText = ""
  count = 0
  while ((i != null) && (i != "") && (j != null) && (j !=""))  {    // ...get next until null
   ++count
   i = ""
   i = prompt (selection.inserttext, "")

   // ... used for debugging form.TEXT.value += "-->" + i + "<--"

   if ((i != null) && (i != ""))  {
    j = ""
    j=prompt (selection.inserttext2, "")
    if ((j != null) && (j != ""))  {
     if (count > 1)  {
      addText += selection.tagmiddle2
     }
     addText=addText +i + selection.tagmiddle + j
    }
   }
  }
 }

 if (selection.insertmode == 5)  {    // ...Anchor
  addText = ""
  i = ""
  i = prompt (selection.inserttext, "")

  // ... used for debugging form.TEXT.value += "-->" + i + "<--"

  if ((i != null) && (i != ""))  {
   j = ""
   j=prompt (selection.inserttext2, "")
   if ((j != null) && (j != ""))  {
    addText=i + selection.tagmiddle + j
   }
  }
 }

 return addText

}

function preview(form)  {

 msg=open("","DisplayWindow","toolbar=no,directories=no,menubar=yes");
 msg.document.write(form.TEXT.value);
}

// end hide -->

</script>
<INPUT TYPE="button" NAME="     View     " VALUE="기본형태" onClick='MakePage(this.form)' onmouseover="this.style.backgroundColor= 'white'" onmouseout="this.style.backgroundColor='#99ccff'">  
<INPUT TYPE="button" NAME="     View     " VALUE="시작하기" onClick='HjButton(this.form,jStart)' onmouseover="this.style.backgroundColor= 'white'" onmouseout="this.style.backgroundColor='#99ccff'">  
<INPUT TYPE="button" NAME="     View     " VALUE="새창으로-미리보기" onClick='ViewPage(this.form)' onmouseover="this.style.backgroundColor= 'white'" onmouseout="this.style.backgroundColor='#99ccff'">  
<INPUT TYPE="button" NAME="     Clear    " VALUE="모두삭제" onClick='ClearText(this.form)' onmouseover="this.style.backgroundColor= 'white'" onmouseout="this.style.backgroundColor='#99ccff'">                                                 
<INPUT TYPE="button" NAME="     View    " VALUE="도움말보기" onClick='hellothere()' onmouseover="this.style.backgroundColor= 'white'" onmouseout="this.style.backgroundColor='#99ccff'">                                                 
<INPUT TYPE="button" NAME="     Usage    " VALUE="사용방법" onClick="{alert(' 사용방법 ')}{alert('자신이 넣고싶은 Home Page 소스를 Text Box 에 넣고...')}{alert('...시험해 보시려면 미리보기 를 눌러서 어떻게 보이는지 보실 수 있습니다 그리고...')}{alert('...다시 기본형태를 만드시려면 기본형태를 누르시면 됩니다...')}{alert('...또 제작한 파일을 저장하고 싶으시면 소스보기를 누르면 파일의 소스가 메모장으로뜸니다...')} {alert('...이걸저장하면 하나의 html문서가 됩니다...')}{alert('...그럼 Html Editer 로 멋진 Home Page 를 만드세요...')}" onmouseover="this.style.backgroundColor= 'white'" onmouseout="this.style.backgroundColor='#99ccff'">
<INPUT TYPE="button" NAME="     View     " VALUE="마무리하기" onClick='HjButton(this.form,jEnd)' onmouseover="this.style.backgroundColor= 'white'" onmouseout="this.style.backgroundColor='#99ccff'">  
<br>                                                 
<br>                                                 
<form NAME="copy">

<DIV align="center">
<input type=button value="소스저장하기" onClick="javascript:this.form.TEXT.focus();this.form.TEXT.select();">   
</DIV>                                                 
<textarea name="TEXT" rows="25" cols="70"  wrap="VIRTUAL">
<html>
<head>
<title>히히</title>
<head>
<body>

 

 

</body>
</html>

 
0
    
 
0
        list
 
※ 짧은 댓글일수록 예의를 갖추어 작성해 주시기 바랍니다.
line
reply cancel
 
번호 제목 글쓴이 추천 조회 날짜
36  자바 스크립트를 이용한 Base64 인코딩, 디코딩 하는 프로그램 예제 파일   member 아침마당 10 / 1 5041 2010-09-07
35  [프린트] 웹페이지의 선택된 영역만 인쇄하기   member 억새풀 0 / 0 10393 2008-02-28
34  자바스크립트에서 파일용량 체크하기   member 억새풀 1 / 0 5518 2008-01-09
33  [HTML] 폼에대한 142가지의 다양한 js 소스   member 웹스톤 1 / 1 6353 2008-01-05
32  자바스크립트 기초(3)   member 웹돌이 0 / 0 7402 2007-12-11
31  자바스크립트 기초(2)   member 웹돌이 2 / 0 6235 2007-12-11
30  자바스크립트 기초(1)   member 웹돌이 2 / 0 9924 2007-12-11
29  [미디어] 배경음악 제어하기   member 오렌지 1 / 0 4245 2007-12-01
28  [form] 텍스트 박스에 자리수 차면 커서 이동시키기   member 다자래 0 / 0 7569 2007-12-01
27  텍스트박스에 영문 대소문자 변환하기..   member 파도 0 / 0 3632 2007-11-30
26  [창과문서] 오른쪽 마우스 사용 못하게 하기   member 웹스톤 0 / 0 4005 2007-11-27
25  [Window] 팝업창에 Post 방식으로 값 넘기기   member 다자래 4 / 1 52754 2007-11-21
24  [Document] 페이지 위치를 알아내기!   member 오렌지 0 / 0 3975 2007-11-21
23  [함수] 자주사용되는 함수들   member 오렌지 0 / 0 4470 2007-11-21
22  [Document] 태그연습장   member 오렌지 0 / 0 7046 2007-11-21
21  [출력] 원하는 부분만 인쇄하기   member 웹스톤 0 / 1 5949 2007-11-20
20  [FORMS] 포인트 추가/감소 태크   member 오렌지 0 / 0 4039 2007-11-20
19  [Window] 공지창 하루에 한번띄우기 첨부파일   member 오렌지 1 / 0 7586 2007-11-20
18  [창과문서] input 박스에 중복 값을 찾아내는 스크립트   member 웹스톤 0 / 0 12315 2007-11-17
17  각종함수모음   member 웹돌이 0 / 0 4936 2007-10-09
16  ESC 누르면 닫히는 팝업창!   member 웹돌이 0 / 0 4465 2007-09-21
15  [창과문서] 문서를 열 때마다 전혀 다른 문서처럼 보이게 하기 이미지   member 웹스톤 0 / 0 5458 2007-09-20
14  [창과문서] 화면 해상도 보여주기   member 웹스톤 0 / 0 4003 2007-09-19
13  썸네일 플러스 이미지업로드 추가   member 웹돌이 0 / 0 4227 2007-09-18
12  multiple select에 추가하는 예제   member 컴퓨터존 0 / 0 4796 2007-09-12
write
[2] button