1
2
3
4
// 약 4622 줄 try cache로 묶어준다.
try{
    style[ name ] = value;
} catch (e){}

[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));
    }
[ActionScript]
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));
    }

테이블의 tbody tr row가 0개일 경우 에러발생, 또한 1개일 경우에도 정렬할 필요 없다.
1
2
// row data 2개 이상일때만 동작하게 한다. 2010-09-1 by ddakker
if( totalRows < 2 ) return;

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.tablescroll.js

jquery.tablesorter.js

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>
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>
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;  
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="확인">
최근에는 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>
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;

+ Recent posts