본문 바로가기

develop/java script

JS 생성자?? 프로토 타입??? The Constructor PatternConstructor – 생성자 – 는 특별한 타입의 객체를 생성하는데 사용됩니다. 자바스크립트에서는 함수가 생성자의 역할을 할 수 있습니다. 그래서 객체를 생성하는데 사용되는 함수를 생성자 함수 – Constructor function – 이라고 합니다. 생성자 함수는 매개변수를 설정할 수 있고, 그것을 생성자 함수를 통해 생성될 객체의 프로퍼티들에 초기값을 주는데 사용할 수 있습니다.Basic Constructors자바스크립트에서 생성자 함수를 사용하는 방법은 인스턴스를 만드는 타당한 방법이라고 생각됩니다. 자바스크립트에는 다른 객체지향 언어에서 사용하는 클래스가 없지만 생성자 함수가 그와 유사한 역할을 할 수 있습니다. new 키워드와 함께 생성자 함수를 실.. 더보기
checkbox tree list value 가져오기 $(document).ready(function(){//jQuery.treeview$("#navigation").checktree();//value 가져오기var checked = [];$("input:checkbox[name='group1']").each(function() { var name = this.name; var val = this.value; if (val) { checked[name] = val; }}).on('change', function() { var name = this.name; var val = this.value; if (val) { checked[name] = val; } else { delete checked[name]; }});}); 해양기후 기온 풍속 풍향 기압 평균파.. 더보기
treeview Jquery treeview js 파일 : Sample 2 - NavigationItem 1Item 1.0Item 1.0.0Item 1.1Item 1.2Item 1.2.0Item 1.2.0.0Item 1.2.0.1Item 1.2.0.2Item 1.2.1Item 1.2.1.0Item 1.2.2Item 1.2.2.0Item 1.2.2.1Item 1.2.2.2Item 2Item 2.0Item 2.0.0Item 2.0.0.0Item 2.0.0.1Item 2.1Item 2.1.0Item 2.1.0.0Item 2.1.1Item 2.1.1.0Item 2.1.1.1Item 2.1.1.2Item 2.1.2Item 2.1.2.0Item 2.1.2.1Item 2.1.2.2 더보기
팝업창 띄우기 //팝업창 띄우기 전 쿠키 체크if (getCookie("notice") != "done") {noticeWindow = window.open('/portal/jsp/popup/cho_EduPopup.jsp', 'eduPop', 'width=300, height=270,marginwidth=0,marginheight=0,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no');noticeWindow.opener = self;} //쿠키 가져오기function getCookie( name ){ var nameOfCookie = name + "="; var x = 0; while ( x 더보기
리플 제한 및 글 개수 변화 스크립트 //리플 제한 스크립트-JSfunction cal_pre(){var tmpStr;tmpStr = document.replySave.description.value;cal_byte(tmpStr);} function cal_byte(aquery) { var tmpStr;var temp=0;var onechar;var tcount;tcount = 0; tmpStr = new String(aquery);temp = tmpStr.length; for (k=0;k 4) { tcount += 2; } else { tcount++; }} document.replySave.cbyte.value = tcount;if(tcount>500) {reserve = tcount-500;nets_check( document.repl.. 더보기
JSON-lib Java Library DOWNLOADJSON-lib - http://sourceforge.net/projects/json-lib/files/json-lib/ DependenciesJSON-lib는 아래의 패키지에 의존성을 가지고 있다.jakarta commons-lang 2.5jakarta commons-beanutils 1.8.0jakarta commons-collections 3.2.1jakarta commons-logging 1.1.1ezmorph 1.0.6 더보기