How to copy text to the client's clipboard using jQuery?

This question already has an answer here:

  • How do I copy to the clipboard in JavaScript? 49 answers

  • 在这里开始搜索并找到https://github.com/terinjokes/zClip - 完全适合我。


    Copying to the clipboard is a tricky task to do in Javascript in terms of browser compatibility. The best way to do it is using a small flash. It will work on every browser. You can check it in this article.

    Here's how to do it for Internet Explorer:

    function copy (str)
    {
        //for IE ONLY!
        window.clipboardData.setData('Text',str);
    }
    

    这里有一些选项:http://www.jquery4u.com/plugins/jquery-copy-clipboard-4-options/#.UFbo1YriYz0

    链接地址: http://www.djcxy.com/p/19712.html

    上一篇: 如何在跨浏览器中读取剪贴板数据?

    下一篇: 如何使用jQuery将文本复制到客户端的剪贴板?