网络编程 
首页 > 网络编程 > 浏览文章

JS+flash实现chrome和ie浏览器下同时可以复制粘贴

(编辑:jimmy 日期: 2025/12/26 浏览:3 次 )
利用2个文件

ZeroClipboard.js

ZeroClipboard.swf
复制代码 代码如下:
<script type="text/javascript" src="/UploadFiles/2021-04-02/ZeroClipboard.js"><script language="JavaScript">

var clip = null;

function $(id) { return document.getElementById(id); }

function init(xm) {
clip = new ZeroClipboard.Client();
clip.setHandCursor( true );

clip.addEventListener('load', function (client) {
debugstr("Flash movie loaded and ready.");
});

clip.addEventListener('mouseOver', function (client) {
// update the text on mouse over
clip.setText($('txt_links').value );
});

clip.addEventListener('complete', function (client, text) {
debugstr(xm );
});

clip.glue( 'd_clip_button', 'd_clip_container' );
}

function debugstr(msg) {
if(msg=='1'){
alert('复制成功,请用Chrl+V粘贴');
//alert('chushihu,请用Chrl+V粘贴');
}else{

}

}
</script>

注意:<body onload="init(1);">
上一篇:jquery的选择器的使用技巧之如何选择input框
下一篇:JS网页播放声音实现代码兼容各种浏览器
友情链接:杰晶网络 DDR爱好者之家 南强小屋 黑松山资源网 白云城资源网 网站地图 SiteMap