html&css&js
- jQuery-1.4.2.js Effect 진행중 중복거래 시 문제점 개선 2010.10.21
- 날짜 계산, 기준일로부터 더하기(+), 빼기(-), 윤달 적용 2010.10.07
- jQuery plugin TableSorter(jquery.tablesorter.js) 버그 개선 2010.10.07
- jQuery Table Scroll plugin(jquery.tablescroll.js) 버그 개선 2010.10.07
- jQuery table row add remove length, cell length 2010.08.25
- jquery SelectBox, ChecoBox SET 예제 2010.08.19
- 이벤트(event) 전파 막기 2010.08.13
- jQuery each 예제 2010.04.30
- 아이디 중복체크(iframe방식) 2010.04.27
- Oracle PL/SQL 2010.04.11
jQuery-1.4.2.js Effect 진행중 중복거래 시 문제점 개선
2010. 10. 21. 10:01
날짜 계산, 기준일로부터 더하기(+), 빼기(-), 윤달 적용
2010. 10. 7. 16:58
[JavaScript]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | /** * 주어진 값 다음의 날짜 구하기(과거는 - 마이너스) * @param nextDateInt 날짜에 더하거나 빼야할 값 * @param nowDate 현재 날짜 및 기준날짜( new Date(), 없을 경우 new Date(), yyyymmdd 8자리) * @return Date */ function getNextDate(nextDateInt, standardDate){ var oneDate = 1000 * 3600 * 24; // 하루 var nowDate; if ( standardDate == undefined ) nowDate = new Date(); else if ( standardDate.getTime != undefined ) nowDate = standardDate; else if ( standardDate.length == 8 ) nowDate = new Date(standardDate.substring(0, 4), parseInt(standardDate.substring(4, 6))-1, standardDate.substring(6, 8)); return new Date(nowDate.getTime() + (oneDate * nextDateInt)); } |
[JAVA]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | /** * 주어진 값 다음의 날짜 구하기(과거는 - 마이너스) * @param nextDateInt 날짜에 더하거나 빼야할 값 * @param nowDate 현재 날짜 및 기준날짜( new Date(), 없을 경우 new Date(), yyyymmdd 8자리) * @return Date */ public static Date getNextDate( int nextDateInt){ return getNextDate(nextDateInt, new Date()); } public static Date getNextDate( int nextDateInt, String nowDateStr){ GregorianCalendar gc = new GregorianCalendar ( Integer.parseInt(nowDateStr.substring( 0 , 4 )), (Integer.parseInt(nowDateStr.substring( 4 , 6 ))- 1 ), Integer.parseInt(nowDateStr.substring( 6 , 8 )) ); return getNextDate(nextDateInt, gc.getTime()); } public static Date getNextDate( int nextDateInt, Date nowDate){ long oneDate = 1000 * 3600 * 24 ; // 하루 return new Date(nowDate.getTime() + (oneDate * nextDateInt)); } |
1 2 3 4 5 6 7 8 9 10 | /** * 주어진 값 다음의 날짜 구하기(과거는 - 마이너스) * @param nextDateInt 날짜에 더하거나 빼야할 값 * @param nowDate 현재 날짜 및 기준날짜 * @return Date */ public static function getNextDate(nextDateInt: int , standardDate: Date ) : Date { var oneDate: Number = 1000 * 3600 * 24 ; // 하루 return new Date (standardDate.getTime() + (oneDate * nextDateInt)); } |
jQuery plugin TableSorter(jquery.tablesorter.js) 버그 개선
2010. 10. 7. 10:56
테이블의 tbody tr row가 0개일 경우 에러발생, 또한 1개일 경우에도 정렬할 필요 없다.
1 2 | // row data 2개 이상일때만 동작하게 한다. 2010-09-1 by ddakker if ( totalRows < 2 ) return ; |
jQuery Table Scroll plugin(jquery.tablescroll.js) 버그 개선
2010. 10. 7. 10:52
table 이 두개 이상 있을 경우 thead tr:first 가 무조껀 소스 상단의 노드만 접근이 된다. jQuery버그인건지... 원래 그런건지.. 확실치 않다.
1 2 3 4 | //$this.children("thead tr:first").attr("style", "position:relative; top:expression(this.offsetParent.scrollTop)"); // 버그로 인한 커스트 마이징..(단 ID사용일때만 가능) 2010-10-07 by ddakker $ this .children( "thead" ).find( "tr:first" ).attr( "style" , "position:relative; top:expression(this.offsetParent.scrollTop)" ); |
jQuery table row add remove length, cell length
2010. 8. 25. 17:50
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | < script > function remove(index){ var btr = $("#tb > tbody > tr"); $(btr[index]).remove(); } function append(){ $("#tb > tbody").append("< tr >< td >a</ td >< td >b</ td >< td >c</ td ></ tr >"); } function getRowCount(){ alert( $("#tb tr").length ); } function getCellCount(rowIndex){ alert( $($("#tb tr")[rowIndex]).children("td, th").length ); } </ script > < button onclick = "append()" >추가</ button > < button onclick = "remove(0)" >삭제</ button > < button onclick = "getRowCount()" >rowCount</ button > < button onclick = "getCellCount(2)" >cellCount</ button > < table id = "tb" border = "1" > < thead > < tr bgcolor = "#CCCCCC" > < th width = "100" scope = "col" >a</ th > < th width = "100" >b</ th > < th width = "100" >c</ th > </ tr > </ thead > < tbody > < tr > < td >1</ td > < td >2</ td > < td >3</ td > </ tr > < tr > < td >4</ td > < td colspan = "2" >5</ td > </ tr > </ tbody > </ table > |
jquery SelectBox, ChecoBox SET 예제
2010. 8. 19. 12:55
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | < select id = "s" > < option value = "1" >a</ option > < option value = "2" selected = "" >b</ option > </ select > < button onclick = "setSelected()" >setSelected</ button > < input type = "checkbox" name = "c" value = "1" >a < input type = "checkbox" name = "c" value = "2" checked = "" >b < button onclick = "setChecked()" >setChecked</ button > < script > function setSelected(){ $("#s > option[value=1]").attr("selected", "true"); } function setChecked(){ $("input[name=c]").filter('input[value=1]').attr("checked", "checked"); } </ script > < form > < input type = "radio" name = "r" value = "1" > < input type = "radio" name = "r" value = "2" > < button onclick = "setChecked()" >getRadio</ button > </ form > < script > function getRadio(){ alert( jQuery("form input:radio[name='r']:checked").val() ); } </ script > |
이벤트(event) 전파 막기
2010. 8. 13. 12:57
1 2 3 4 5 6 7 8 | // 캡춰단계 이벤트 처리 하고, 버블단계 막기 if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true ; // 브라우저 이벤트 막기 if (event.preventDefault) event.preventDefault(); else event.returnValue = false ; |
jQuery each 예제
2010. 4. 30. 10:17
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | < script > $(document).ready(function(){ $("#send").click(function(){ $("div div").each(function(index, element){ alert(index + "\n\n" + element.innerHTML + "\n\n" + $(this).html()); }); }); }); </ script > < div > < table > < tbody >< tr > < td >< div id = "td1" >td1 index0</ div ></ td > </ tr > < tr > < td >< div id = "td1" >td1 index1</ div ></ td > </ tr > < tr > < td >< div id = "td1" >td1 index2</ div ></ td > </ tr > </ tbody ></ table > </ div > < input type = "button" id = "send" value = "확인" > |
아이디 중복체크(iframe방식)
2010. 4. 27. 10:30
최근에는 ajax방식만 사용하다가 사용하게 될 일이 있어서 사용했는데 오래간만에 사용하니 방법을 잊어버려서 삽질했군요.
정리의 습관!!(했던거 그냥 적은거라 오타 있을 수 있음..)
정리의 습관!!(했던거 그냥 적은거라 오타 있을 수 있음..)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | < script > function onCheckIDHandler(){ var id = document.getElementById("id").checkID.value; document.getElementById("frm").target = "ifTarget"; document.getElementById("frm").checkID.value = id; document.getElementById("frm").submit(); } </ script > < input type = "text" name = "id" id = "id" > < img src = "" onclick = "onCheckIDHandler()" style = "cursor:pointer" > < form id = "frm" method = "post" src = "url" style = "margin:0px" > < input type = "hidden" name = "checkID" > </ form > < iframe id = "ifTarget" style = "width:0px; height:0px; display:none" ></ iframe > |
Oracle PL/SQL
2010. 4. 11. 23:59
1 2 3 4 5 6 7 8 9 10 11 12 13 | declare Cursor emp_cursor is Select seq,subject from board; begin dbms_output.put_line( 'seq subject' ); dbms_output.put_line( '------ ---- -------' ); for c1 in emp_cursor loop dbms_output.put_line(to_char(c1.seq) || ' ' || c1.subject); insert into insert_test(test) values (c1.subject); end loop; end ; |