글 복사 할때 자동 출처까지 복사 시키기
<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>
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년 전
감사합니다
15년 전
파일 어느분에 들어가는것인지 알수 없을까요 ? 좋은 기능 같은데요
terrorboys
15년 전
컨텐츠를 감싸주세요.
sinbi
2년 전
관련글: https://developer.mozilla.org/en-US/docs/Web/API/Event/returnValue
게시글 목록
| 번호 | 제목 |
|---|---|
| 34706 | |
| 34693 | |
| 34563 | |
| 34536 | |
| 34521 | |
| 34480 | |
| 34479 | |
| 34466 | |
| 34437 | |
| 34436 | |
| 34435 | |
| 34406 | |
| 34398 | |
| 34387 | |
| 34382 | |
| 34375 | |
| 34364 | |
| 34336 | |
| 34294 | |
| 34293 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기