zclip工作时,我点击身体,但我试图让它复制到剪贴板,而不点击(加载)
$("#copy-button").click();
我认为问题出在$("#copy-button").zclip
我试图在doucment加载时使zclip复制一个字符串
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="./jquery.zclip.min.js"></script>
<script type="text/javascript">
$(document).ready
(function () {
$("#copy-button").zclip({
path: "http://codescratcher.com/download/ZeroClipboard.swf",
copy: 'hello',
beforeCopy: function () { },
afterCopy: function () {
//alert('Copy To Clipboard : \n' + $('#copy-button').val());
}
});
});
$("#copy-button").click();
</script>
<body id="copy-button"><p>hey</p></body>
我甚至尝试过
$(document).ready(zclip);