我正在尝试创建一个按钮,该按钮将使用 zclip 将 html 代码复制到剪贴板。
这是我正在使用的代码:
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('button#copy_code').zclip({
path:'<?php bloginfo('template_directory'); ?>/js/ZeroClipboard.swf',
copy: '
<h1 style="text-align: center;">
<strong>
How to Make A Website in 10 Minutes with Arvixe
</strong>
</h1>
<br>
<iframe src="http://www.youtube.com/embed/9_grBUEtxPY?iv_load_policy=3&vq=large&rel=0&modestbranding=1&autoplay=0&controls=0;showinfo=0" height="325" width="580" frameborder="0"></iframe></p>'
});
})
</script>
</div>
<br>
<button id="copy_code" type="button" class="copylink_b">
</button>
但是,它不起作用。按钮不会做任何事情。此按钮在使用纯文本时有效,但在尝试复制 html 时无效。如何使用 zclip 复制 html?