Click the button to copy the link to my clipboard [compatible with all browsers], and click the link

Source: Internet
Author: User

Click the button to copy the link to my clipboard [compatible with all browsers], and click the link

First, take a look at my notes: Click me


Compatible with JQuery zClip plug-ins of all browsers for copying to clipboard
Load the JQuery library and zclip plug-in

  1. <ScriptType = "text/javascript" src = "js/jquery-1.8.1.min.js"></Script> 
  2. <ScriptSrc = "js/jquery. zclip. min. js"></Script> 

Below is a small demo, mainly copying the link in the text box to the clipboard.
HTML
  1. <InputType = "text" value = "www.baidu.com" id = "link"> 
  2. <SpanId = "copyBtn">Copy Link</Span> 

Then add the script
Not necessarily the input tag, as long as the text can be obtained.
  1. <Script> 

  2. $ ('# CopyBtn'). zclip ({
  3. Path: "ZeroClipboard.swf ",
  4. Copy: function (){
  5. Return $ ('# link'). val ();
  6. }
  7. });

  8. </Script> 


Google Chrome clicks the button to copy and paste. Why can't I copy and paste it? Note: (copying an image is not a link)

It may be that the website does not support the Chrome kernel, causing a false death. I also have this problem with the latest DEV. Sometimes Baidu Google gets stuck and can use the Stable Board 10.

Google Chrome clicks the button to copy and paste. Why can't I copy and paste it? Note: (instead of copying images, copying a connection) 8565

I have no problem,
Maybe you can try the shortcut:
Copy: ctrl + c
Paste: ctrl + v

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.