我正在使用cdnjs
中的ZeroClipboard v2.2.0运行此代码:
$(document).ready(function() {
$("tr td:last-child").each(function() {
var element = $(this);
var button = $('<button type="button" class="btn btn-xs copy-to-clipboard" data-clipboard-text="' + element.html() + '" title="Copy UUID"><span class="glyphicon glyphicon-file"></span></button>');
button.tooltip();
button.appendTo(element);
var clipboard = new ZeroClipboard(button);
clipboard.on("ready", function(event) {
clipboard.on("aftercopy", function(event) {
alert("Copied: " + event.data["text/plain"]);
});
});
});
});
此代码在表格中插入copy to clipboard
按钮:
但是,当我拖动其中一个copy to clipboard
按钮时,firebug会显示此异常:uncaught exception: Error in Actionscript. Use a try/catch block to find error.
我做错了什么?