글 복사 할때 자동 출처까지 복사 시키기
<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
3년 전
관련글: https://developer.mozilla.org/en-US/docs/Web/API/Event/returnValue
게시판 목록
그누4 팁자료실
그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.
나누면 즐거움이 커집니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 3209 | 12년 전 | 4909 | ||
| 3208 |
Header
|
12년 전 | 3245 | |
| 3207 |
Header
|
12년 전 | 2858 | |
| 3206 |
Header
|
12년 전 | 4323 | |
| 3205 |
Header
|
12년 전 | 3867 | |
| 3204 |
Header
|
12년 전 | 6043 | |
| 3203 |
Header
|
12년 전 | 3246 | |
| 3202 | 12년 전 | 4491 | ||
| 3201 | 12년 전 | 4764 | ||
| 3200 | 12년 전 | 4386 | ||
| 3199 | 12년 전 | 5054 | ||
| 3198 |
|
12년 전 | 4940 | |
| 3197 |
|
12년 전 | 4688 | |
| 3196 | 12년 전 | 5065 | ||
| 3195 |
|
12년 전 | 4371 | |
| 3194 | 12년 전 | 4453 | ||
| 3193 | 12년 전 | 10838 | ||
| 3192 | 12년 전 | 9495 | ||
| 3191 | 12년 전 | 5144 | ||
| 3190 | 12년 전 | 8500 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기