홈페이지를 만드는 사람들을 위한 안내서
XE 새로고침없는 댓글 작성
조회 수 23 추천 수 0 2022.11.01 17:28:381. 대댓글 버튼
<a cond="$oDocument->allowComment()" class="re_comment" href="javascript:;" onclick="<!--@if(!$grant->write_comment || !$oDocument->isEnableComment())-->alert('{$lang->msg_not_permitted}')<!--@else-->reComment({$comment->get('document_srl')},{$comment->get('comment_srl')},'{getUrl('act','dispBoardReplyComment','comment_srl',$comment->comment_srl)}')<!--@end-->;return false;"> <i class="fa fa-comment"></i> {$lang->cmd_reply} </a>
2. 대댓글 버튼 스크립트
<script> // 대댓글 돔 구조 변경 function reComment(doc_srl,cmt_srl,edit_url){ $.getScript('/rx/common/js/plugins/ckeditor/ckeditor/ckeditor.js', function() { console.debug('Script loaded.'); }); // var o = jQuery('#re_cmt').eq(0); var o = jQuery('.comment-form').eq(0); o.find('input[name=error_return_url]').val('/'+doc_srl); o.find('input[name=mid]').val(current_mid); o.find('input[name=act]').val('dispBoardReplyComment'); o.find('input[name=document_srl]').val(doc_srl); o.appendTo(jQuery('#comment_'+cmt_srl)).fadeIn().find('input[name=parent_srl]').val(cmt_srl); // o.find('a.wysiwyg').attr('href',edit_url); // o.find('textarea').focus(); setTimeout(() => { console.log("Delayed for 1 second."); $("iframe.cke_wysiwyg_frame.cke_reset").ready(function() { var add = "<p><br></p>"; var body = $("iframe.cke_wysiwyg_frame.cke_reset").contents().find("body"); body.attr('className','rhymix_content xe_content editable color_scheme_light cke_auto_dark_mode cke_editable cke_editable_themed cke_contents_ltr cke_show_borders'); body.attr('spellCheck','false'); body.attr('contentEditable','true'); body.append(add); }); }, "500"); } </script>