테스트 사이트 - 개발 중인 베타 버전입니다

글 복사 할때 자동 출처까지 복사 시키기

· 15년 전 · 5103 · 4
<script language="javascript">
function contents_scp(sdz)
{
if (window.event)
{
window.event.returnValue = true;
window.setTimeout('attach_sdref("'+sdz+'")', 25);
}
}
function attach_sdref(sdz)
{
if (window.clipboardData) // IE
{
// get data from clipboard
var txt = window.clipboardData.getData('Text');
// attach the source at the end of text
txt = txt + '\r\n(출처 :  '+sdz+')';  // set data to clibboard
var result = window.clipboardData.setData('Text', txt);
}
}
</script>
<div oncopy='contents_scp("");'>
내용
</div>

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 4개

15년 전
감사합니다
파일 어느분에 들어가는것인지 알수 없을까요 ? 좋은 기능 같은데요
컨텐츠를 감싸주세요.
관련글: https://developer.mozilla.org/en-US/docs/Web/API/Event/returnValue

게시글 목록

번호 제목
34021
33994
33922
33895
33889
33882
33868
33863
33859
33857
33849
33842
33835
33830
33828
33807
33797
33796
33791
33786