js/swf -> 复制文字到剪贴板
通过JS + FLASH 的形式可 完美的 解决浏览器的兼容问题。
需要文件 swfobject.js , clipboard.swf , 用于显示的 图片 (flash_copy_btn.png) 。见附件
<span id="forLoadSwf"></span> <script src="{$domain}static/swfobject.js" type="text/javascript"></script> <script type="text/javascript"> var copyCon = "343"; var flashvars = { content: encodeURIComponent(copyCon), uri: '{$domain}static/flash_copy_btn.png' }; var params = { wmode: "transparent", allowScriptAccess: "always" }; swfobject.embedSWF("{$domain}static/clipboard.swf", "forLoadSwf", "52", "25", "9.0.0", null, flashvars, params); function copySuccess(){ //flash回调 alert("复制成功!"); } </script>
相关推荐
阿斌Elements 2020-06-11
88274956 2020-11-03
Zhongmeishijue 2020-09-10
runner 2020-09-01
梦的天空 2020-08-25
IdeaElements 2020-08-19
luvhl 2020-08-17
移动开发与培训 2020-08-16
ReunionIsland 2020-08-16
lyqdanang 2020-08-16
NARUTOLUOLUO 2020-08-03
MyNameIsXiaoLai 2020-07-08
星辰的笔记 2020-07-04
csstpeixun 2020-06-28
letheashura 2020-06-26
liaoxuewu 2020-06-26
OldBowl 2020-06-26
北京老苏 2020-06-25
Luffyying 2020-06-25