This site is original. For reprinted, please state the source of your home
I found someone asking me for such Code recently. When I copy the article on this site, I can add a sentence as long as I copy the content on this site, this article is reprinted from the script home and added with the content address. This will provide many benefits for the promotion of this site. You can search for it, for example, a better way to add reverse connections.
Copy codeThe Code is as follows:
Document. body. oncopy = function () // triggers a function when a replication event occurs, whether it is ctrl + c or right-click-copy
{
SetTimeout (
Function ()
{
Var text = clipboardData. getData ("text ");
If (text)
{
Text = text + "\ r \ n this article is reproduced from the script home:" + location. href;
ClipboardData. setData ("text", text );
}
},
100
)
}
Window. onload = function ()
{
This. focus (); // obtain the focus after the content is loaded.
}