Copy content automatically add the article link address of the JS code

Source: Internet
Author: User

<!doctype HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> copy content automatically add the article link address of the JS code </title>


<script type= "text/web Effects" >
Document.body.oncopy = function () {
settimeout (function ()
{
var text = clipboarddata.getdata ("text");
if (text) {
Text = text + "This article comes from [Left Bank] (http://www.111cn.net) Original source:" +LOCATION.HREF;
Clipboarddata.setdata ("text", text);
}
}, 100)
}
</script>

<body>
Fdsafsa
Dagdsaf
S
Af
Sda
F
Sa

<input type= "button" name= "Submit" onclick= ' CopyToClipboard () ' value= ' Copy this page article address, to the Qq/msn friend "width=" "height=" ">
<script language= "JavaScript" >
function CopyToClipboard () {
var clipboardcontent= "";
Clipboardcontent+=document.title;
clipboardcontent+= "";
Clipboardcontent+=this.location.href;
Window.clipboarddata.setdata ("text", clipboardcontent);
Alert ("Copy successful, paste on your qq/msn to recommend to your friends");
} </script>


</body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.