Pellentesque sodales, velit tempor pharetra ultricies, lacus odio mattis ligula, vel sollicitudin erat nisl sed nisi. Etiam pretium pulvinar sapien, et ultrices augue euismod sagittis. Maecenas congue ligula eu arcu rhoncus volutpat. Maecenas laoreet neque vitae magna porta sed euismod urna ornare. Morbi varius, erat et cursus ornare, elit augue bibendum leo, sed imperdiet nulla risus ut ipsum. Aliquam imperdiet ante a justo luctus et bibendum erat porta. To test it out, copy something from the paragraph below and paste it into your favorite text editor.Īenean vel massa tellus. Just add this between your page’s head tags, and change the copyright notice to whatever you want. Var newdiv = document.createElement('div') Var pagelink = " Read more at: "++"Copyright © c.bavota" // change this if you want
Var body_element = document.getElementsByTagName('body') Then the function will work for all major browsers. Sorry IE people, this one won’t work for you, though if anyone figures out a fix for IE let me know. It took a lot of messing around and I was finally able to put something together that worked in most browsers. All I needed my function to do was grab the copied selection, tack on a copyright notice and then add the two to the clipboard. That’s cool and all, but I wanted to see if I could make it happen using JavaScript. Turns out, they use a service called Tynt.
#Copyright copy paste how to
I thought that was kind of neat and tried to figure out how to do it. I was checking out the CBC website and I noticed that if you copy and paste any text from the site a reference link appears at the bottom, indicating the source.