str.replace(/,/g,'') => 매칭 되는 전체를 바꿀 경우
str.replace(',','') => 하나 밖에 안 바뀜
// 1. dom document component 생성
xmldoc = new ActiveXObject("Msxml2.DOMDocument.3.0");

// 2. xml문서 양식의 data를 loadXML을 사용해 load
xmldoc.loadXML( data );
       
// 3. 출력 샘플
alert ( "평균입고:" + xmldoc.getElementsByTagName("dataset")[4].getAttribute("tot_stockin") + "\n평균출고:" + xmldoc.getElementsByTagName("dataset")[4].getAttribute("tot_deliv") );
document.onkeydown = keypressed;

function keypressed()
{
   if (event.keyCode == 13)
       check_submit();
}

// javascript에서 enter키를 칠 경우 check_submit을 실행함

// 데이터 공유를 위한 간단한 표현방식 정도라고 얘기 할 수 있다.
var myJSONObject = {"bindings": [
        {"ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*"},
        {"ircEvent": "PRIVMSG", "method": "deleteURI", "regex": "^delete.*"},
        {"ircEvent": "PRIVMSG", "method": "randomURI", "regex": "^random.*"}
    ]
};

// Members can be retrieved using dot or subscript operators.
 myJSONObject.bindings[0].method    // "newURI"
 

// JSON text를 object롤 변경하기 위해서는 eval() function을 사용해야 한다.
// 보통 ajax에서 json으로 return받으면 eval을 사용해 object에 입력해야 함
var myObject = eval('(' + myJSONtext + ')');

<script language="javascript">

 // JavaScript Pet class 
 function Pet(name) {
     this._name = name;
 }
 
// method나 property를 사용하기 위해선 prototype키워드를 사용해야 한다
 Pet.prototype._name;
 
 // method는 return type을 선언하지 않는다.
 // javascript class는 method나 property를 참조 할 경우 항상 this키워드를 써야한다.
 // 이 점은 php나 동일하다.
 Pet.prototype.getName = function() {
     return this._name;
 }
 
 
 var p = new Pet("Max");
 alert(p.getName());
 
</script>

Ajax에서 이것을 어떻게 사용할 수 있을가?
do, undo를 만들고 factory도 만들어 사용할 수 있을까?

toFixed()를 사용하면 된다.
toFixed(0)을 사용하면 소숫점 위의 숫자만 출력..좋네~

예제
<script type="text/javascript">

var num = 3.14;

// 그대로 출력
document.write(num, '<br />');
// 출력 결과: 3.14

// 소수점 이하 6자리로 강제로 출력
document.write(num.toFixed(6), '<br />');
// 출력 결과: 3.140000




num = 3.1415926535897932384626433832795;

// 그대로 출력
document.write(num, '<br />');
// 출력 결과: 3.141592653589793

// 소수점 이하 3자리로 출력
document.write(num.toFixed(3), '<br />');
// 출력 결과 (반올림됨): 3.142


</script>