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("");
}

수정한 파일:
번호 제목 글쓴이 날짜 조회 수
246 [Gemini] ajax 와 fetch 의 차이 황제낙엽 2025.01.04 3419
245 [검토 완료] 디바이스 카메라로 촬영한 사진을 서버에 업로드하기 샘플 황제낙엽 2024.11.21 3988
244 브라우저에서 이미지를 편집(crop 등) 할 수 있는 오픈소스 Cropper.js 황제낙엽 2024.11.16 3842
243 [ChatGPT] json data 의 정렬 [1] 황제낙엽 2024.07.23 3357
242 DOMContentLoaded 이벤트와 window.onload 이벤트 황제낙엽 2024.07.15 3673
241 fetch() 사용 예제들 황제낙엽 2024.07.09 3382
240 [Copilot] Vanilla JavaScript에서 외부 스크립트 파일에 정의된 함수들을 로드 황제낙엽 2024.06.21 3759
239 [Copilot] ES6 모듈(module) 문법 황제낙엽 2024.06.21 3812
238 [Copilot] JSON 객체 내부 데이터를 순회하면서 조회하는 코드 황제낙엽 2024.06.02 3272
237 [Copilot] JavaScript로 서버에 특정 값을 POST 방식으로 전달하고 응답을 기다리지 않고 바로 종료 황제낙엽 2024.05.31 3620
236 json 데이터 내의 변수명에 prefix 로 type 표현하기 황제낙엽 2024.04.15 3363
235 fetch() 함수 사용 예제 file 황제낙엽 2023.11.23 3607
234 현재 document 의 host 와 port 를 얻는 방법 황제낙엽 2023.10.03 4211
233 (Bard) FileReader 로 여러개의 파일을 read 하는 법 file 황제낙엽 2023.08.23 3665
232 How to build a file upload service with vanilla JavaScript file 황제낙엽 2023.08.22 3715
231 (Bard) JavaScript로 JSON 배열을 작성하는 방법 황제낙엽 2023.08.21 3674
230 모바일 브라우저에서 file input element 를 이용하여 여러장의 이미지를 서버에 전송하려 할때 [1] 황제낙엽 2023.08.21 3704
229 navigator.mediaDevices 황제낙엽 2023.08.21 3799
228 Barcode Detection API 황제낙엽 2023.08.06 3859
227 정규식을 이용한 이메일 검증 스크립트 file 황제낙엽 2023.06.25 2895