모체 문서에 나타나는HTC(HTML Component)의 메서드를 정의한다.
![]() |
Script | parentObj.method.propName[=propVal]; |
HTML | <PUBLIC:METHOD propName="propVal"/> |
name 애트리뷰트를 지정하는 것은 엘레멘트에서 정이된 표준 이벤트와 비슷하다. 비헤이버는 엘레멘트의 디폴트 비헤이버를 덮어씌운다.
![]() | method⇒ | ![]() | ⇒ | ![]() ![]() ![]() |
method 설명을 위한 예제
|
<public:method id="oObj" internalname="sInternalName" name="sName"></public:method> |
![]() | method⇒ | ![]() | ⇒ | ![]() ![]() ![]() |
엘레멘트 정보
모체 엘레멘트 | PUBLIC:COMPONENT |
---|---|
모체 엘레멘트 | 없슴 |
최소 버전 | IE5 |
최소 OS | Windows95, WindowsNT4.0 |
![]() | method⇒ | ![]() | ⇒ | ![]() ![]() ![]() |
![]() | method⇒ | ![]() | ⇒ | ![]() ![]() ![]() |
용기 문서에 PUBLIC:METHOD 태그로 HTC doShow 메서드를 생성하여 호출하였다.
<HEAD>
<STYLE>.publicShow {behavior:url(../object/exp/myShow.htc)}</STYLE>
</HEAD>
<BODY>
<DIV class="publicShow" id="showId" name="showName"
style="height:2em;border:solid 1 blue;background:ffa" onclick="this.doShow()">클릭하여 결과 얻기</DIV>
../object/exp/myTestHTC.htc의 내용
<PUBLIC:COMPONENT name="doShowCom">
<PUBLIC:METHOD name="doShow" />
<SCRIPT>
function doShow(){
str='event.type='+event.type+'\n';
str+='this.id='+this.id+'\n';
str+='this.name='+this.name+'\n';
str+='this.nodeName='+this.nodeName+'\n';
str+='this.className='+this.className+'\n';
str+='this.style.cssText='+this.style.cssText+'\n';
prevColor = this.style.color;
str+='this.style.color='+this.style.color+'\n';
element.style.color = 'red';
element.style.cursor = 'hand';
str+='element.style.color='+element.style.color+'\n';
str+='element.style.cursor='+element.style.cursor+'\n';
alert(str);
}
</SCRIPT>
</PUBLIC:COMPONENT>
![]() | method | ⇒ | ![]() ![]() |
최종 수정: 06/30/2025 00:38:19 | ![]() All right reserved | 비정상적인 방식으로 프레임없이 페이지에 접속하면 자주 오류가 발생됩니다. 오류가 나면 정상적 접속으로 시도해 보세요. | http://koxo.com/lang/js/object/publicMethod.html |