Ctrl + C 로 복사하면 붙여넣기할때 출처표시하기

<html>

<head>

<title>드래그 복사</title>

<script language=JavaScript>

function contents_cp()

{

if (window.event)

{

window.event.returnValue = true;

window.setTimeout(‘attach_kinref()’, 25);

}

}

function attach_kinref()

{

if (window.clipboardData) // IE

{

// get data from clipboard

var txt = window.clipboardData.getData(‘Text’);

// attach the source at the end of text

txt = txt + ‘rn(출처 : http://www.iambloger.com)rn’;

// set data to clibboard

var result = window.clipboardData.setData(‘Text’, txt);

}

}

</script>

</head>

<body>

<div id=’contents_area’ onCopy=’javascript:contents_cp();’>

여기를 마우스로 드래그 해서 복사한 다음 다른 곳에 붙여넣기를 해보세요.

</div>

</body>

출력할 메시지는 출처 : http://www.iambloger.com 부분을 수정하면 됩니다.

그리고 아래의 레이어 안에 존재하여야 합니다.

<div id=’contents_area’ onCopy=’javascript:contents_cp();’>

여기를 마우스로 드래그 해서 복사한 다음 다른 곳에 붙여넣기를 해보세요.

</div>



(출처 : HappyCGI)