https://gall.dcinside.com/mgallery/board/view?id=github&no=76521
넷스케이프 6.0부터 최신 크롬까지 전부 호환되는 사이트 만들기재미삼아서 해봤어자바스크립트 폴리필만 거의 300줄이 됐네...(참고로 내 메인 브라우저는 페일 문(Pale Moon)이랑 씨몽키(SeaMonkey)고 크롬은 서브로 써)gall.dcinside.com
이 글의 프론트엔드 js 코드 중 일부인데 AI들도 막 타임캡슐이라면서 신기해하는 반응이던데 ㅋㅋㅋ
/* 텍스트 복사 */function copy(content) {
try {
if(window.noclipapi || window.manualcopy) throw 1;
navigator.clipboard.writeText(content);
} catch(e) { try {
if(window.manualcopy) throw 1;
var input = document.createElement('input');
input.style.width = '0px';
input.style.height = '0px';
input.style.border = 'none';
input.style.padding = '0';
input.style.margin = '0';
document.body.appendChild(input);
input.value = content;
input.select();
document.execCommand('copy', false, null);
input.remove();
} catch(e) {
prompt(window.manualcopy ? '아래에 있는 필드에서 복사할 내용을 선택한 다음 직접 복사할 수 있습니다.' : '복사할 수 없습니다. 브라우저가 너무 오래되었을 수도 있습니다. 아래에서 직접 복사하십시오.', content);
} }
}
/* 팝업창 띄우기 */function openWindow(url, width, height, resizable, name, nochrome) {
if(window.isMobile || window.netscape8)
return location.assign(url);
try {
netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite');
} catch(e) {
}
if(url.indexOf('?') > -1) url += '&aspopup=1';
else url += '?aspopup=1';
if(resizable) url += '&resizablepopup=1';
var w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
var h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
var top = window.screenY || window.screenTop;
var left = window.screenX || window.screenLeft;
/*if(window.showModalDialog)
showModalDialog(url, {}, 'dialogwidth:' + width + 'px;dialogheight:' + height + 'px;dialogtop:' + (top + h - height + 100) + ';dialogleft:' + (left + w - width - 25) + ';resizable:' + (resizable ? 1 : 0) + ';scroll:no;status:0');
else*/
open(url, name || '_blank', 'popup=' + (window.isNotFirefoxQuantum && window.isNetscapeBased ? 'no' : 'yes') + ',directories=no,' + (resizable ? 'resizable=yes,scrollbars=yes' : 'resizable=no,scrollbars=no,dialog=yes,close=no,alwaysRaised=yes,dependent=yes,minimizable=no,modal=yes') + ',width=' + width + ',height=' + height + ',top=' + (top + h - height + 100) + ',left=' + (left + w - width - 25) + ',screenX=' + (left + w - width - 25) + ',screenY=' + (top + h - height + 100) + ',innerWidth=' + width + ',innerHeight=' + height + ',menubar=no,addressbar=no,address=no,status=no,statusbar=no,toolbar=no,location=no,personalbar=no,titlebar=yes,chrome=' + (nochrome ? 'no' : 'yes'));
}
딱 제이쿼리 나오기 전인거같누
이 댓글은 게시물 작성자가 삭제하였습니다.
ㅋㅋㅋㅋ
@호선이 삭제 뭔데 ㄷㄷ
이 댓글은 게시물 작성자가 삭제하였습니다.
@엘리시아JS(182.231) 광고링크
개발자를 옛날부터 하셨어요?