로그인

이메일
비밀번호
DaeYoung's Blog : 위치로그 : 태그 : 방명록 : 관리자 : 새글쓰기
자바스크랩트 패키지 만들기
Web/JavaScript, (2007년 04월 26일 15시 01분)
<SCRIPT LANGUAGE="JavaScript">
<!--
var harogi = new Object(); //harogi 패키지 만듬

harogi.MyClass = function(){ //harogi.MyClass생성자
        var name = "";
        var id = "";
}

harogi.MyClass.prototype.setValue = function(name, id){
        this.name = name;
        this.id = id;
}

harogi.MyClass.prototype.getName = function(){
        return this.name;
}

harogi.MyClass.prototype.getId = function(){
        return this.id;
}

var mem1 = new harogi.MyClass();
mem1.setValue("홍길동", "hong");
document.write(mem1.getName());
document.write(mem1.getId());

//////////////////////////////////////
MyClass = function(){
        var name = "";
        var id = "";
}

MyClass.prototype.setValue = function(name, id){
        this.name = name;
        this.id = id;
}

MyClass.prototype.getName = function(){
        return this.name;
}

MyClass.prototype.getId = function(){
        return this.id;
}


var mem2 = new MyClass();
mem2.setValue("임꺽정", "im");
document.write(mem2.getName());
document.write(mem2.getId());
/////////////////////////////////////////

harogi.newClass = {}; //패키지 정의

harogi.newClass.MyClass = function(){
        var name = "";
        var id = "";
}

harogi.newClass.MyClass.prototype.setValue = function(name, id){
        this.name = name;
        this.id = id;
}

harogi.newClass.MyClass.prototype.getName = function(){
        return this.name;
}

harogi.newClass.MyClass.prototype.getId = function(){
        return this.id;
}

var mem3 = new harogi.newClass.MyClass();
mem3.setValue("임꺽정", "im");
document.write(mem3.getName());
document.write(mem3.getId());
//-->
</SCRIPT>
http://laedu.net/trackback/12
JSON 표기, 클래스
Web/JavaScript, (2007년 04월 26일 14시 51분)
<SCRIPT LANGUAGE="JavaScript">
<!--
Member = function(name, id){
   this.name = name ;
   this.id = id ;
}

Member.prototype = {
        setValue: function(newName, newId){
                this.name = newName;
                this.id = newId;
        },

        getName: function(){
                return this.name;
        },

        getId: function(){
                return this.id;
        }
}

var mem1 = new Member();
mem1.setValue("홍길동", "hong");
document.write(mem1.getName());
document.write(mem1.getId());
//-->
</SCRIPT>
http://laedu.net/trackback/11
JSON 표기 법
Web/JavaScript, (2007년 04월 26일 14시 48분)
<SCRIPT LANGUAGE="JavaScript">
<!--
//JSON(JavaScript Object Notation) : 다른 프로그래밍 언어 간의 데이터를 교환하기 위한 표기법
//주로 이름/값 같은(자바의 Map이나Hashtable 처럼) 표현하거나 배열로 표현


var mem = {lee:"이씨", park:"박씨", kim:"김씨"}; //표현법1
document.write(mem.lee);  //접근법
document.write(mem.park);
document.write(mem.kim);

var mem1 = ["lee","park","kim"];//배열형태
document.write(mem1[0]);


/////// 혼합형태 /////////////

var mem3 = {
        name:"홍길동",
        etc:[35, "남", "대구"]
};
document.write(mem3.name); //홍길동
document.write(mem3.etc.length); //3
document.write(mem3.etc[0]);//35
document.write(mem3.etc[1]);//남
document.write(mem3.etc[2]);//대구
//-->
</SCRIPT>
http://laedu.net/trackback/10
DaeYoung's Blog 블로그에 오신것을 환영해요^^
웹기반 프로그래밍에 관한 것들을 모을 예정이었는데..
«   2024년 10월   »
    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 31    
Javax.mail 참고 사이트.
C# TextBox KeyDown, KeyPr...
SID가 여러개 있을때 'ORA...
https://scrapingmaster.blogg...
https://scrapingmaster.blogg.. 2023년
expertdecoders.com.
expertdecoders.com 2023년
expertdecoders.
expertdecoders 2023년
best decaptcha service.
best decaptcha service 2023년
capcher.
capcher 2023년
328
104
1023866