일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- ibsheet
- MySQL
- oracle
- GPS
- PHP
- tomcat
- 선택적조인
- swingx
- Eclipse
- MFC
- PLSQL
- JSON
- iBATIS
- Spring
- phonegap
- WebLogic
- jQuery
- Ajax
- JDOM
- Android
- sencha touch
- Google Map
- node.js
- Struts
- 전자정부프레임워크
- dock
- 가우스
- appspresso
- jsr 296
- rowspan
Archives
- Today
- Total
Where The Streets Have No Name
actsAsAspect 예제 본문
<script src="actsAsAspect.js" language="javascript"></script>
<script language="javascript">
function fncLoad(){
actsAsAspect(txt_name);
txt_name.onchange = fncChange; /* event handler는 advice정의 부분보다 위에 와야함 */
txt_name.after(
'onchange',
binding /* advice handler */
);
}
/* advice handler */
function binding(){ ta_debug.value += this.id+"[after] : "+this.value+"\n"; }
function fncChange(){ ta_debug.value += this.id+" : onChange \n"; }
</script>
<body onload="fncLoad()">
<input type="text" id=txt_name>
<br>
<textarea id=ta_debug style="width:300px;height:100px"></textarea>
</body>
<script language="javascript">
function fncLoad(){
actsAsAspect(txt_name);
txt_name.onchange = fncChange; /* event handler는 advice정의 부분보다 위에 와야함 */
txt_name.after(
'onchange',
binding /* advice handler */
);
}
/* advice handler */
function binding(){ ta_debug.value += this.id+"[after] : "+this.value+"\n"; }
function fncChange(){ ta_debug.value += this.id+" : onChange \n"; }
</script>
<body onload="fncLoad()">
<input type="text" id=txt_name>
<br>
<textarea id=ta_debug style="width:300px;height:100px"></textarea>
</body>