////////////box////////////////////////////////////////////////////////// //댓글 리스트 function fCommentList(page, boardtype) { jQuery.ajax({ url: "../board/" +boardtype +"/" +boardtype +"_tail_list.php", type: 'POST', data: "bc_board_no=&categoryid=&menuid=&groupid=&partid=&page=" + page, error: function(){ alert('에러발생'); }, success: function(data){ $('#tail').html(data); } }); } //댓글 달기 function pCommentWrite(pSeq, mode,boardtype){ var f = document.getElementById('boardCommentForm_'+ pSeq); f.tailmode.value = mode; if (!f.bc_name.value) { /* alert("로그인을 해주세요."); document.location.href = "http://science.hwi.kr/main/main.php?categoryid=01&menuid=01&groupid=00"; return false;*/ alert("작성자명을 입력해주세요."); f.bc_name.focus(); return false; } if (!f.bc_content.value) { alert("내용을 입력해주세요."); f.bc_content.focus(); return false; } var options = { error: function(){ alert("에러.."); }, success: function(data){ fCommentList(1); $('#tail').html(data); }, url: "../board/" +boardtype +"/" +boardtype +"_tail_exec.php", type: 'POST', data: $("#boardCommentForm_" +pSeq).serialize(), }; $("#boardCommentForm_" +pSeq).ajaxSubmit(options); } //댓글 삭제 function pCommentDel(pSeq, mode,boardtype){ var f = document.getElementById('boardCommentForm_'+ pSeq); f.tailmode.value = mode; var confirm_check = confirm("댓글을 삭제하시겠습니까?"); if (confirm_check) { var options = { error: function(){ alert("에러.."); }, success: function(data){ // alert($("#boardCommentForm_" +pSeq).serialize()); fCommentList(1); $('#tail').html(data); }, url: "../board/" +boardtype +"/" +boardtype +"_tail_exec.php", type: 'POST', data: $("#boardCommentForm_" +pSeq).serialize(), }; $("#boardCommentForm_" +pSeq).ajaxSubmit(options); } } //댓글 수정 function fCommentListWriteForm(pSeq) { $('.ly_pop').hide(); $('#comment_list_td_'+ pSeq).show(0); $('#cm_contents'+ pSeq).hide(0); $('#UpdateOv'+ pSeq).hide(0); $('#UpdateOff'+ pSeq).show(0); } function fCommentListWriteFormClose(pSeq) { $('.ly_pop').show(); $('#comment_list_td_'+ pSeq).hide(0); $('#cm_contents'+ pSeq).show(0); $('#UpdateOv'+ pSeq).show(0); $('#UpdateOff'+ pSeq).hide(0); } function fCommentUpdControl(pSeq){ var f = document.getElementById('boardCommentForm_'+ pSeq); $('#bc_name_'+ pSeq).val(' 이름 ').hide(); $('#comment_upd_btn_'+ pSeq).show(); f.board.value = ""; f.tailmode.value = ""; }