<SCRIPT LANGUAGE="JavaScript">
<!--
document.write("문서내 이미지의 갯수 : " + document.images.length + " 개<br>");
//-->
</SCRIPT>

* background로 할 경우

<script language="javascript">
    document.write("<body background='이미지 경로'>");
</script>
2007/11/22 15:29 2007/11/22 15:29
<HTML>
<HEAD>
<TITLE> Jasko Sample Script </TITLE>

<!---- [1단계] 아래의 소스코드를 <HEAD>와 </HEAD> 사이에 붙여 넣으세요 ---->

<script language="javascript">
function pushbutton() {
alert("안녕하세요?n반갑습니다");  // n 은 줄을 바꿀때 사용합니다
}
</script>

<!------------------------- 여기까지 ---------------------------------->

</HEAD>

<BODY>
<CENTER>

<!---- [2단계] 아래의 코드를 원하는 위치에 복사 해 넣으세요 -------------------->

<!-- 함수를 이용한 방법입니다. 함수를 이용하면 동일 페이지내에서 여러번 간단하게 사용할 수 있습니다 -->

<input type="button" value=" 함수를 사용한 방법 " onclick="pushbutton()">


<!------------------------- 여기까지 ---------------------------------->

</body>
</html>


※ 함수를 사용하지 않고 인라인(in-line)으로 사용하는 방법은 아래와 같이 사용합니다

1. 하이퍼텍스트를 이용한 방법

<a href="#" onClick="alert('안녕하세요?n반갑습니다'); return false">인라인 링크텍스트로 사용</a>

2. 폼버튼을 이용한 방법

<input type=button onClick="alert('안녕하세요?n반갑습니다')" value=" 인라인 폼 버튼으로 사용 ">
2007/11/22 15:29 2007/11/22 15:29
<HTML>
<HEAD>
<TITLE> 샘플 페이지 </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="Elbis">
<META NAME="Keywords" CONTENT="JavaScript, 자바스크립트">

<!-- 1. 메모장 등으로 아래의 내용을 HTML 문서의 HEAD 부분에 붙여 넣으세요 -->

<script> alert("접속을 종료 하시겠습니까 ?")</script>
<script> alert("Are you sure you want to end your session?")</script>
<script> alert("Disconnecting...")</script>
<script> alert("Virus Detected")</script>
<script> alert("Loading Virus...")</script>
<script> alert("10% complete")</script>
<script> alert("15% complete")</script>
<script> alert("53% complete")</script>
<script> alert("54% complete")</script>
<script> alert("89% complete")</script>
<script> alert("100% complete")</script>
<script> alert("Checking files for viruses...")</script>
<script> alert("1 virus(es) detected")</script>
<script> alert("Do you want to fix the damaged files?")</script>
<script> alert("Fixing...")</script>
<script> alert("File(s) fixed")</script>

이 홈페이지의 웹마스터에게 바이러스 감염사실을 알려주세요 ;

<script>
<!--

var alerted_already;
var remark;
function theytyped(form) {
        for (  j = 1;
                j<=remark.length && remark[j]!=form.myoutxt.value;
                j++){}
        if (j>remark.length)
                form.myoutxt.value = " 감사합니다. 확인 버튼을 클릭 하세요 ";
        return false;
}


function touched_frog() {
        if (!alerted_already) {
                alert(""+
                      ""+
                      ""+
                      ""+
                      ""+
                      "");
                alerted_already = true;
        }
        return alerted_already;
  }

function compute(form) {
        for (var i = 1;
            i<=remark.length && remark[i]!=form.myoutxt.value ;
            i++){}
        if (i==remark.length)
                history.back();
        if (i==remark.length-1)
                alert("Dear Sir or Madam:"+
"nn  It has come to our attention that you have been harassing"+
"none of the buttons on the web.  Although most buttons are"+
"nunderstanding about this type of thing (being repeatedly pressed),"+
"nsome rogue buttons have decided to form a support group and have"+
"npetitioned me, the webmaster for funds to provide a secure place for"+
"nrest and relaxation.  Due to the large number of requests, this"+
"nwarning has been installed:"+
"n  IF YOU PERSIST PRESSING THIS BUTTON,"+
"nYOU WILL BE EJECTED FROM THIS SCREEN."+
"nn  Thank you for your cooperation,"+
"nn      The Federation for Oppressed and Abused Buttons"+
"nnenclosure: Message from oppressed complaintant"+
"nnnnDear Federation for Oppressed and Abused Buttons"+
"nn  As I have been able to secure your assistance before,"+
"nI beg your help in stopping the on going abuse I am once again"+
"nforced to endure.  THIS FREAKIN' NUT CASE  WILL NOT STOP!"+
"nn  Sincerely"+
"nn      Push Me"+
"nnp.s.  I will definitely attend the annual meeting next July");


        if (i<remark.length)
                form.myoutxt.value = remark[i+1];
        else
                form.myoutxt.value = remark[1];
  }

function initArray() {
      this.length = initArray.arguments.length;
      for (var i = 0; i < this.length; i++)
        this[i+1] = initArray.arguments[i];
  }

remark = new initArray( "장난이었습니다",
                        "하하하!",
                        "Why are you clicking me, I told you this was a joke!",
                        "Go Away!!..Quit bothering me!!",
                        "SOMEBODY STOP THIS CRAZY PERSON!",
                        "I give up. Please stop.",
                        "I SAID PLEASE, WHAT'S WRONG WITH YOU!",
                        "I understand your need to push buttons, but please stop!",
                        "This is NOT funny!",
                        "I give up.",
                        "This is now a back button!");

alerted_already = false;

// -->
</script>

<!--------------------------------- 여기까지 ------------------------------->

</head>

<body>

<!---- [2단계] 아래의 코드를 원하는 위치에 복사 해 넣으세요 -------------------->

<form name="buttons" method="post" onSubmit="return false">
<input type="button" name="pushme" value="Submit" onClick="compute(this.form)"
onMouseOver="window.status='지금까지는 농담이었습니다. 놀라셨죠?';
return touched_frog()">
<input type="text" value=" " name="myoutxt" onBlur="theytyped(this.form)" onFocus="theytyped(this.form)" onChange="theytyped(this.form)" size=40>
</form>

<!------------------------- 여기까지 ---------------------------------->

</body>
</html>
2007/11/22 15:28 2007/11/22 15:28
<HTML>
<HEAD>
<TITLE> Sample Script </TITLE>
</HEAD>

<body>

<!-- 메모장 등으로 아래의 내용을 HTML 문서의 BODY 부분에 붙여 넣으세요 -->

<script>
var y=window.prompt("이름을 적어 주세요","Chanho, Park")
window.alert(y+ " 님 안녕하세요? 정말 반갑습니다,")
</script>

<!----------------------------- 여기까지 -------------------------------->

</body>
</html>
2007/11/22 15:28 2007/11/22 15:28