Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 |
Tags
- 국제화
- paint
- layout
- Spring
- 메서드
- 에러페이지
- AWT
- Menu
- oracle
- 어노테이션
- 이클립스
- struts2
- Eclips
- 전화걸기
- 클래스
- 생성자
- 기본
- HTML
- JSP
- mybatis
- Java
- Android
- 오버로딩
- 배열
- 메소드
- JavaScript
- OGNL
- 예외처리
- 안드로이드
- Graphic
Archives
- Today
- Total
note
동적으로 메서드 추가 본문
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <script> //변수를 선언합니다. var student= {}; student.이름 = '윤인성'; student.취미 = '악기'; student.특기 = '프로그래밍'; student.장래희망 = '생명공학자'; // to String() 메서드를 만듭니다 student.toString = function(){ var output =''; for(var key in this){ //toString()메서드는 출력하지 않게합니다. if(key != 'toString'){ output += key + '\t' + this[key] + '\n'; } } return output; }; //출력합니다 alert(student.toString()); </script> </head> <body> </body> </html>