以下适用于 .php 上的 chrome、IE9 和 Firefox:
$(document).ready(function(){
$('#copyLinkButton').zclip({
path: "js/zclip/zclip.swf",
copy: function(){
return $('#linkToCopy').html();
},
beforeCopy:function(){
},
afterCopy:function(){
//succes
}
});
});
但是在对话框中打开它,它只适用于 Firefox 和 IE9 兼容模式:
$('.open-lv-form').live({
click: function() {
//define link
var linkViewId = this.id;
$.ajax({
type: "GET",
cache: false,
url: "redirect.php",
data: "id="+linkViewId,
success: function(response){
$("#lv-form-content").html(response);
}
});
//open
$( "#lv-form" ).dialog( "open" );
return false;
}
});
是 IE 和 Chrome 处理字段的方式吗?为什么它可以在 Firefox 中运行,而不是在 chrome 和 IE 中运行?
提前致谢!
更新: IE9(f12)在 zclip.min.js 第 12 行从字符 3666 说运行时错误,行说:
this.div.innerHTML=this.getHTML(c.width,c.height)}
仍然没有解决方案,继续尝试:)
更多信息:剪贴板 IE 8 和 7 中的 Jquery ZeroClipboard 或 Zclip nothing
更新#2:
在 IE 中解决了使用这个而不是 zClip:
window.clipboardData.setData('text',item.url);
现在只有 Chrome 在苦苦挣扎。似乎 chrome 中有一个安全功能可以禁用与操作系统的交互。让我知情!