글 수 157
| 자료출처 : | |
|---|---|
| 미리보기 : |
간단히 설명 하자면, 페이지내에 정해진 영역 안의 컨텐츠를 복사(Ctrl+c)하면 복사한 내용 끝에 미리 설정된 내용이 같이 복사가 됩니다.
<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 + '\r\n(출처 : nontoxlc - '+title_js_var+')\r\n';
// set data to clibboard
var result = window.clipboardData.setData('Text', txt);
}
}
//-->
</script>
<script> var title_js_var = "내껍니다"; </script>
<div id='contents_area' onCopy='javascript:contents_cp();'>
내용~
</div>
--><!--
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 + '\r\n(출처 : nontoxlc - '+title_js_var+')\r\n';
// set data to clibboard
var result = window.clipboardData.setData('Text', txt);
}
}
//-->
</script>
<script> var title_js_var = "내껍니다"; </script>
<div id='contents_area' onCopy='javascript:contents_cp();'>
내용~
</div>













