1. JavaScript ¾ð¾î ¼Ò°³
JavaScript | Java | |
½ÇÇà¹æ¹ý | browser ¿¡¼ Çؼ®°ú ½ÇÇà (Interprete/Script) | ¼¹ö¿¡¼ compile ÈÄ object code ¸¦ ºÒ·¯¼ browser¿¡¼ ½ÇÇà |
¼º°Ý | object-based | object-oriented |
ÇüÅ | HTMLÆÄÀÏ ³»¿¡ °°ÀÌ ±â¼ú (Æ÷ÇÔ) | HTMLÆÄÀÏÀÇ °ø°£¿¡¼ ½ÇÇà |
º¯¼öÇü | Á¤ÇÒ ÇÊ¿ä ¾øÀ½ | º¯¼öÇü Á¤ÀÇ ÇÊ¿ä |
<Form Action="" Method=GET
Name=f1>
<Img Src="arrow.gif" Name=bul> ³ªÀÌ => <INPUT Name=age Type=Text Size = 10> <INPUT Name = in_btn Type = button value ="È®ÀÎ" onClick = ' if (document.f1.age.value < 20) document.bul.src = "paw.gif" else document.bul.src = "arrow.gif" ' > </Form> |
<SCRIPT language = "Javascript">
document.write("<HR width=200>"); document.write("** ¹®¼Á¦¸ñ: "); document.write(document.title + "<BR>"); document.write("** ¹®¼ÀÛ¼º½Ã°¢:<BR>"); document.write(document.lastModified); </SCRIPT> |
½ÇÇà°á°ú
=>
|
with (document) {
write ("<BR>** ¹®¼ÀÛ¼º ÃÖÁ¾½Ã°¢ : ") ; writeln (lastModified) write ("** ¿¹Á¦ ÆÄÀÏ[" + location + "]") } |
½ÇÇà°á°ú => |
<A Href = "index.html"
onClick = "alert('´©¸£Áö¸¶½Ã¿À')" onMouseOver = "window.status = 'Àç¹ÌÀÖ´Â °÷'; return true" > status bar¿¡ ¹®ÀÚ¿, Ŭ¸¯. . . </A> |
<INPUT type = "button"
name = "¡¦" value ="µÚ·Î °¡±â"
onClick = "history.back()" > |
<INPUT type = "button"
name = "¡¦" value ="³ë¶õ»öÀ¸·Î"
onClick = "document.bgColor = 'yellow' " > <INPUT type = "button" name = "¡¦" value ="Èò»öÀ¸·Î" onClick = "document.bgColor = 'white' " > |
<INPUT type = "button" name
= "¡¦" value ="»õ·Î¿î À©µµ¿ì"
onClick = " window.open(); " > <INPUT type = "button" name = "¡¦" value ="´Ý±â¹öÆ° ¿¹Á¦" onClick = " window.open('close.html'); " > |
"close.html" | <INPUT type = "button"
name = "¡¦" value ="È¸é ´Ý±â"
onClick = " if (confirm('Á¾·áÇÏ°Ú½À´Ï±î ?')) window.close(); else alert('ÀÔ·Â Ãë¼Ò') " > |
<Head>
<script language = "Javascript" > function age_check() { var age age = prompt ("³ªÀÌ ÀÔ·Â => ") if (age > 18) alert (" O.K ! ") else { alert (" ¹æ¹® ºÒ°¡ ") history.back() } } </script> </Head> |
<Body onLoad = "age_check()" >
</Body> |