Because you need to make a js click to copy the function of the current web page URL. The following method is used, but it can only be used normally under the IE browser.
Here's how:
Copy the code code as follows:
function copyURL(){
var clipBoardContent="";
clipBoardContent+=document.title;
clipBoardContent+="";
clipBoardContent+=this.location.href;
window.clipboardData.setData("Text",clipBoardContent);
alert("Copied successfully, please paste it into your QQ/MSN and recommend it to your friends");
}
-----------------------Divider line----------------------- ----
Found a flash online
zClip
zClip
The zClip plug-in is compatible with various browsers.
The method of use is very simple, you only need to import a js file and a swf file.
How to use it
You need to import the required files first:
Copy the code code as follows:
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.zclip.js"></script>
$(document).ready(function(){
$('a#copy-description').zclip({
path:'js/ZeroClipboard.swf',
copy:$('p#description').text()
});
// The link with ID "copy-description" will copy
// the text of the paragraph with ID "description"
$('a#copy-dynamic').zclip({
path:'js/ZeroClipboard.swf',
copy:function(){return $('input#dynamic').val();}
});
// The link with ID "copy-dynamic" will copy the current value
// of a dynamically changing input with the ID "dynamic"
});
There are also some configuration methods, please see the official website for details: http://www.steamdev.com/zclip/
Plug-in download address