js 复制内容到粘贴板的兼容性
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="WebApplication3.Index" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
本报讯 (记者 王鑫) 昨日记者获悉,百度诉360劫持流量案终审宣判,法院判决书表明,奇虎360以保护网民利益为借口,对百度网页搜索结果进行插标,并非是为了公共利益,而是为了奇虎公司的经营私利,扰乱了互联网秩序。对此,法院维持一审原判,360不正当竞争行为成立,赔偿百度40万元。
</div>
</form>
</body>
</html>
<script language="javascript" type="text/javascript">
document.body.oncopy = function () {
event.returnValue = false; var word = window.getSelection ? window.getSelection().toString() : document.selection.createRange().text;
if (navigator.userAgent.toLowerCase().indexOf('ie') > -) { window.clipboardData.setData("Text", word + "http://www.baidu.com");
alert("该地址已复制到剪切板!");
} else {
prompt("非IE内核浏览器,请复制以下内容:", word + "http://www.baidu.com");
} }
</script>
js 复制内容到粘贴板的兼容性的更多相关文章
- js复制内容到粘贴板
点击右边内容:<span onclick="copyContent(this);" title="点击复制">啊,我被复制了</span> ...
- js实现复制内容到粘贴板
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...
- js点击按钮复制内容到粘贴板
复制内容到粘贴板,就是要选择需要复制的内容并执行document.execCommand("copy")命令: //复制内容到粘贴板 function copyToClipboar ...
- js插件实现点击复制内容到粘贴板,兼容IE8
先来看下本次需要导入的文件: 第一个是jquery.js,这个不多说: 第二个是jquery.zclip.js,第三个是zeroClipboard.swf ,这两个文件的下载链接:http://www ...
- vue 复制内容到粘贴板
首先是npm安装依赖包:npm install clipboard --save 导入组件:import Clipboard from "clipboard"; html如图: c ...
- JS复制文本到粘贴板,前端H5移动端点击按钮复制文本
<span id="codeNum">FTYHDSDW</span> <span class=" code-btn" id=&qu ...
- js 复制文本到粘贴板
//html 在iOS Safari中,剪贴板API有一些限制(实际上是安全措施): 于安全原因,iOS Safari只允许容器中的document.execCommand('copy')文本co ...
- vue复制textarea文本域内容到粘贴板
vue实现复制内容到粘贴板 方案:找到textarea对象(input同样适用),获取焦点,选中textarea的所有内容,并调用document.execCommand("copy&q ...
- 原生js实现复制文本到粘贴板
项目中经常会遇到点击按钮复制订单号.订单id等内容到粘贴板中的需求.可是通常我们都是用Ctrl + c或右击复制的,别操心,js也是有复制命令的,那就是document.execCommand('co ...
随机推荐
- Codeforces 724E Goods transportation(最小割转DP)
[题目链接] http://codeforces.com/problemset/problem/724/E [题目大意] 每个城市有pi的物品可以运出去卖,si个物品可以买, 编号小的城市可以往编号大 ...
- Java如何进行异常处理
关键字:throws.throw.try.catch.finally的用法 Java通过面向对象的方法进行异常处理,把各种不同的异常进行分类,并提供了良好的接口.在Java中,每个异常都是一个对象,它 ...
- 8VC Venture Cup 2016 - Final Round (Div. 2 Edition) D. Factory Repairs 树状数组
D. Factory Repairs 题目连接: http://www.codeforces.com/contest/635/problem/D Description A factory produ ...
- node.js创建并引用模块
app.js var express = require('express'); var app = express(); var con = require('./content'); con.he ...
- 使用神经网络识别手写数字Using neural nets to recognize handwritten digits
The human visual system is one of the wonders of the world. Consider the following sequence of handw ...
- [转]Working with Transactions (EF6 Onwards)
本文转自:http://www.cnblogs.com/xiepeixing/p/5275999.html Working with Transactions (EF6 Onwards) This d ...
- xampp Apache Access forbidden! Error 403解决方法
今天下载了最新的xampp,配置了一个虚拟主机,一直在报错,Access forbidden! Error 403 这很明显是服务器不允许访问文件,但是我的虚拟主机配置如下: DocumentRoot ...
- 【笔记】探索js 的this 对象 (第一部分)
最近在看 你不知道的javascript 这本书,在第二部分看到了一个比较重要的知识点 那就是 this对象的全面认识,于是做一下笔记 博主本人在看这本书之前也一直以为 this 是指一切引用类型的本 ...
- select()/poll() 的内核实现
mark 引用:http://janfan.cn/chinese/2015/01/05/select-poll-impl-inside-the-kernel.html 文章 select()/poll ...
- Mapper not initialized. Call Initialize with appropriate configuration.
System.InvalidOperationException:“Mapper not initialized. Call Initialize with appropriate configura ...