web前端|js教程
JS,复制,剪贴板
web前端-js教程
诱导页源码,vscode f12跳转,ubuntu svn搭建,tomcat接受请求原理,前端爬虫node,php当前文件目录,荆州网店seo推广开户,完整可直接使用政府网站asp源码,dz婚纱摄影模板lzw
/*
* 复制到剪贴板
*
* */
android 网页源码下载,战神 ubuntu 失败,设置tomcat发布的时间,web爬虫平台,不用框架开发php 后果,seo适合做什么兼职优化lzw
function copyToClipboard(txt) {
if(window.clipboardData) {
window.clipboardData.clearData();
window.clipboardData.setData("Text", txt);
} else if(navigator.userAgent.indexOf("Opera") != -1) {
window.location = txt;
} else if (scape) {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
} catch (e) {
showAlert("被浏览器拒绝!
请在浏览器地址栏输入about:config并回车
然后将signed.applets.codebase_principal_support设置为 rue\");
}
var clip = Components.classes[@/widget/clipboard;1].createInstance(Components.interfaces.nsIClipboard);
if (!clip)
return;
var trans = Components.classes[@/widget/transferable;1].createInstance(Components.interfaces.nsITransferable);
if (!trans)
return;
trans.addDataFlavor( ext/unicode);
var str = new Object();
var len = new Object();
var str = Components.classes["@/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
var copytext = txt;
str.data = copytext;
trans.setTransferData("text/unicode",str,copytext.length*2);
var clipid = Components.interfaces.nsIClipboard;
if (!clip)
return false;
clip.setData(trans,null,clipid.kGlobalClipboard);
showMessage("复制成功!");
}else if(window.navigator.userAgent.indexOf("Chrome") !== -1 ){
var dialog = $("#sanwn_clipboardDialog");
if(dialog.length==0){
var text = "
搜索 筛选 源码,vscode评测,ubuntu nasm,tomcat输入,sqlite 异步读,境外服务器出租,wordpress没中文插件,java 前端框架排行,网络爬虫 赚钱,php性能差,seo基础营销,flash 茶叶网站,网页翻页按钮,制作模板,html写手机页面,php在线客户管理系统,在线播放视频程序phplzw
“;
$(“body”).append( $(text));
$(“#sanwn_clipboardDialog”).omDialog({
autoOpen: false,
height: 140,
modal: true
});
dialog =$( “#sanwn_clipboardDialog”);
}
$(“#sanwn_clipboardTxt”).val(txt);
$(“#sanwn_clipboardDialog”).omDialog(“open”);
document.getElementById(“sanwn_clipboardTxt”).select();
}
}
如果觉得《JS复制到剪贴板示例代码【javascript】》对你有帮助,请点赞、收藏,并留下你的观点哦!