³Ý½ºÄÉÀÌÇÁ ¶óÀ̺êÄ¿³ØÆ® ¿¹Á¦

author : Yoon Kyung Koo(yoonforh@yahoo.com)
Copyright (c) 1999 Yoon Kyung Koo, All rights reserved.
<-¾ÖÇø´
<-ÀÚ¹Ù ½ºÅ©¸³Æ® Form
 
 

 

APPLET ¼³Á¤

¾ÖÇø´À» ÄÄÆÄÀÏÇÒ ¶§¿¡´Â Ŭ·¡½º °æ·Î¿¡ ´ÙÀ½À» Æ÷ÇÔÇØ¾ß ÇÑ´Ù.
/netscape/communicator/program/java/classes/java40.jar (³Ý½ºÄÉÀÌÇÁ Ä¿¹Â´ÏÄÉÀÌÅÍ 4ÀÇ °æ¿ì)

 <APPLET NAME = liveapplet  : NAME ű׸¦ Áà¾ß ÀÚ¹Ù ½ºÅ©¸³Æ®¿¡¼­ ¾ÖÇø´ °´Ã¼¸¦ ¾Ë ¼ö ÀÖ´Ù.
  MAYSCRIPT                      : MAYSCRIPT ´Â ÀÚ¹Ù ½ºÅ©¸³Æ®¿¡°Ô ÀÌ ¾ÖÇø´¿¡ Á¢±ÙÇÒ ±ÇÇÑÀ» ÁØ´Ù.
  CODE = LiveApplet WIDTH=100 HEIGHT=50 : ÀϹÝÀûÀÎ ¾ÖÇø´ ű׵é
>
</APPLET>

¾ÖÇø´ ¼Ò½º:LiveApplet.java

ÀÚ¹Ù½ºÅ©¸³Æ®<->¾ÖÇø´ È£Ãâ

1. ÀÚ¹Ù ½ºÅ©¸³Æ®¿¡¼­ ÀÚ¹Ù ¾ÖÇø´ ¸Þ¼Òµå È£ÃâÇÏ´Â ºÎºÐ
<FORM NAME="form1" OnSubmit='document.liveapplet.setURL(document.for m1.str.value);return false;'>
<INPUT TYPE="text" SIZE="20" NAME="str">
<INPUT TYPE="button" VALUE="URL ÁöÁ¤"
   onClick="document.liveapplet.setURL(document.form1.str.value)">
</FORM>
setURL ¸Þ¼Òµå´Â liveappletÀ̶ó°í NAMEÀ» ÁöÁ¤Çß´ø ¾ÖÇø´ÀÇ ¸Þ¼ÒµåÀÌ´Ù.(FORM¿¡¼­ return false;¸¦ ÇÏ´Â °ÍÀº CGI GETÀÌ È£ÃâµÇ´Â °Í(Submit)À» ¹æÁöÇϱâ À§ÇÑ °ÍÀÌ´Ù.)

2. ÀÚ¹Ù ¾ÖÇø´¿¡¼­ ÀÚ¹Ù ½ºÅ©¸³Æ® ÇÔ¼ö¸¦ È£ÃâÇÏ´Â ºÎºÐ
     JSObject win  = null;
     win  = JSObject.getWindow(this);
     win.eval("alert(\"Exception:Malformed URL!\");");
    String argv[]={urlstring, "newWindow", "200", "100"};
    win.call("openWindow", argv);
ÇöÀç ¾ÖÇø´À» Æ÷ÇÔÇÏ°í ÀÖ´Â ºê¶ó¿ìÀú À©µµ¿ì¿¡ ´ëÇÑ ÂüÁ¶¸¦ ±¸ÇÏ´Â ÇÔ¼ö°¡ static ÇÔ¼öÀÎ netscape.javascript.JSObject.getWindow(this) ÀÌ´Ù.
ÀÚ¹Ù ½ºÅ©¸³Æ®ÀÇ ³»Àå ÇÔ¼ö(¿©±â¼­´Â alert)¸¦ È£ÃâÇÒ ¶§¿¡´Â eval("ÇÔ¼ö") ¸Þ¼Òµå,
»ç¿ëÀÚ Á¤ÀÇ ÇÔ¼ö(¿©±â¼­´Â openWindow)¸¦ È£ÃâÇÒ ¶§¿¡´Â call("ÇÔ¼ö À̸§",  ÀÎÀÚ_¹è¿­) ¸Þ¼Òµå¸¦ È£ÃâÇÑ´Ù.

Âü°í : ÀÎÅÍ³Ý ÀͽºÇ÷η¯ 4.0 À̻󿡼­µµ netscape.javascript.JSObject¸¦ Áö¿øÇÑ´Ù.


Last modified: Thu Mar 09 10:39:06 2000