sitelink1  
sitelink2  
sitelink3  
sitelink4 http://1 
extra_vars4 ko 
extra_vars5 http://azkidev.tistory.com/entry/envjs-사용시-부족한-부분-수정 
extra_vars6 sitelink1 
env.js 의 몇가지 부족한 점이 있어서 수정한 부분에 대해 포스팅..

원본: 


원본 파일에서 내게 필요했던 부분 (innerHTML) 중에 잘못 구현되어 있거나, 부족했던 부분이 아래와 같이 있어서 수정하였다.
  1. html 에서 inline style 이 나타나지 않는 문제.
  2. 내용이 없는 경우 닫는 태그가 없는 문제.
  3. 결과물 문자열을 만드는 방식이 문자열 변수에 계속 += 연산자를 사용하는 방식이라서 비효율적으로 동작하는 문제(조금 복잡한 DOM을 다루게 되면 innerHTML을 한번 구하는데 1분 이상 걸리는 등 심각한 성능 문제가 나타남).
env.rhino.js 파일의 6404 번째 라인쯤에 있는 xhtml getter 함수를 다음과 같이 수정합니다.

get xhtml() {
// HTMLDocument.xhtml is non-standard
// This is exactly like Document.xml except the tagName has to be 
// lower cased.  I dont like to duplicate this but its really not
// a simple work around between xml and html serialization via
// XMLSerializer (which uppercases html tags) and innerHTML (which
// lowercases tags)
var ret = "",
ns = "",
name = (this.tagName+"").toLowerCase(),
attrs,
attrstring = "",
i,
retArray = [],
childRet;

// serialize namespace declarations
if (this.namespaceURI){
if((this === this.ownerDocument.documentElement) ||
(!this.parentNode)||
(this.parentNode && 
(this.parentNode.namespaceURI !== this.namespaceURI)))
ns = ' xmlns'+(this.prefix?(':'+this.prefix):'')+
'="'+this.namespaceURI+'"';
}
// serialize Attribute declarations
attrs = this.attributes;
for(i=0;i< attrs.length;i++){
attrstring += " "+attrs[i].name+'="'+attrs[i].xml+'"';
}
var _toCamel = function(name) {
if(name){
return name.replace(/-(w)/g, function(all, letter){
return letter.toUpperCase();
});
}
return name;
};
if (this.style && this.style.length > 0) {
attrstring += " style="";
var so = this.style;
var i, sl = so.length;
for(i = 0; i < sl; ++i){
attrstring += so[i] + ":" + so[_toCamel(so[i])] + ";";
}
attrstring += """;
}
if(this.hasChildNodes()){
// serialize this Element
retArray.push("<");
retArray.push(name);
retArray.push(ns);
retArray.push(attrstring);
retArray.push(">");
for(i=0;i< this.childNodes.length;i++){
childRet = this.childNodes[i].xhtml;
retArray.push(childRet? childRet: this.childNodes[i].xml);
}
retArray.push("</");
retArray.push(name);
retArray.push(">");
}else{
retArray.push("<");
retArray.push(name);
retArray.push(ns);
retArray.push(attrstring);
retArray.push("></");
retArray.push(name);
retArray.push(">");
}
return retArray.join("");
}

수정한 파일:
번호 제목 글쓴이 날짜 조회 수
157 XMLHttpRequest 의 이벤트 onreadystatechange 황제낙엽 2012.05.30 412
156 JavaScript 재입문 황제낙엽 2012.05.29 50
155 진행 상황 추적하기(XMLHttpRequest.readyState) file 황제낙엽 2012.05.23 324
154 JavaScript Touch and Gesture Events iPhone and Android 황제낙엽 2012.04.12 337
153 Javascript ArrayBuffer ? Binary handling in javascript 황제낙엽 2012.03.19 218
152 오류:호출자(서버 응용 프로그램이 아닌 서버)가 사용될 수 없어서 사라졌습니다. file 황제낙엽 2012.03.14 1950
151 Alert 에서의 개행처리 황제낙엽 2012.03.09 80
» env.js 사용시 부족한 부분 file 황제낙엽 2012.02.15 33
149 Rhino 와 env.js 를 사용해서 자바 서버에서 javascript 를 구동해보자 file 황제낙엽 2012.02.15 116
148 외부 라이브러리 (.js) 의 바람직하지 않은 동적 로딩 (eval함수 이용) 황제낙엽 2012.01.18 1851
147 IFrames and cross-domain security file 황제낙엽 2012.01.13 246
146 자바스크립트 숫자형 체크 함수 (isFinite() 함수 와 isNaN() 함수) 황제낙엽 2011.12.13 67
145 char to hex string 황제낙엽 2011.11.29 206
144 Understanding delete 황제낙엽 2011.11.28 61
143 JScript Memory Leaks 황제낙엽 2011.11.28 69
142 JavaScript Reserved Words 황제낙엽 2011.11.28 94
141 Reference Count (순환참조) 황제낙엽 2011.11.24 191
140 IE and Memory accumulation in Javascript (document.createElement()) file 황제낙엽 2011.11.24 30
139 String Performance: Getting Good Performance from Internet Explorer (IE7) 황제낙엽 2011.11.24 312
138 Memory leak 및 성능 측정 도구 file 황제낙엽 2011.11.23 666