Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • script for copy to clipboard

    • 0
    • 1
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 226
    Comment on it

    Copy to clipboard.. You can see this option in most of the blogs. You can simply click on the link and it will copy the text which set as target. Today we are going to discuss the implementation of this feature. We can see different ways to do the same but due to the security reasons those scripts are not working. Thanks to Zeroclipboard which is basically a library. You can simply implement this feature with the help of this library. Zeroclipboard library using pitch of flash as well as touch of javascript. Please have a look for the html part

    <script type="text/javascript" src="ZeroClipboard.js"></script>
    <textarea name="copy-content" id="copy-content" rows="7" cols="60">
        We are sharing the script of copy in clipborad
    <p><input type="button" id="copytoboard" name="copytoboard" value="Copy to Clipboard" /></p>

    You can use the library functions as follows.

    //set path
    //create client
    var clip = new ZeroClipboard.Client();
    clip.addEventListener('mousedown',function() {
    clip.addEventListener('complete',function(client,text) {
        alert('copied: ' + text);
    //glue it to the button

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: