붙여넣기 금지 방법이.......
본문
붙여넣기 방지 찾다보니
$(document).ready(function(){ $(document).keydown(function(event) { if (event.ctrlKey==true && (event.which == '118' || event.which == '86')) {
alert('thou. shalt. not. PASTE!');
event.preventDefault();
}
});
});
위 소스를 발견했는데 적용방법을 어떻게 해야할지 문의좀 드릴께요...
특정 게시판의 댓글에 붙여넣기 금지 시키려고합니다...단!!..여기서 관리자는 제외하고...
어찌해야할까요?
!-->
답변 1
코드 예시입니다.
<?php if (!$is_admin) { ?>
//Disable cut copy paste
$('.tbl_frm01 #wr_content').on('cut copy paste', function (e) {
alert('복사/붙여넣기 단축키 사용은 금지되어 있습니다.');
e.preventDefault();
});
//Disable mouse right click
$(".tbl_frm01 #wr_content").on("contextmenu",function(e){
alert('마우스 우클릭 사용은 금지되어 있습니다.');
return false;
});
<?php } ?>
답변을 작성하시기 전에 로그인 해주세요.