ZeroClipboard 用于单击复制。两个链接都提供相同的输出,而不是不同的。演示链接在这里
<a id="c101" href="javascript:void(0);">OBJ1</a>
<a id="x101" href="javascript:void(0);">OBJ2</a>
<script type="text/javascript">
var dom_obj1 = document.getElementById('c101');
var dom_obj2 = document.getElementById('x101');
var clip1 = new ZeroClipboard();
clip1.glue(dom_obj1);
clip1.addEventListener( 'dataRequested', function(client, args) {
client.setText('text1');
});
clip1.addEventListener( 'complete', function(client, args) {
alert('clip1 text: '+args.text);
});
var clip2 = new ZeroClipboard();
clip2.glue(dom_obj2);
clip2.addEventListener( 'dataRequested', function(client, args) {
client.setText('text2');
});
clip2.addEventListener( 'complete', function(client, args) {
alert('clip2 text: '+args.text);
});
</script>