怎么实现 复制自动添加版权信息随机显示位置 而不是显示在文章最下面
//复制内容自动添加版权信息
var thehits=document.getElementById("thehit");
if (thehits!=null){
thehits.innerHTML="22936";
}
document.body.oncopy = function ()
{
setTimeout(
function ()
{
var text = clipboardData.getData("text");
if (text)
{
text = text + "本文转自,原文地址:"+location.href;
clipboardData.setData("text", text);
}
},
100
)
}
window.onload = function()
{
this.focus();
}
//复制内容自动添加版权信息
var thehits=document.getElementById("thehit");
if (thehits!=null){
thehits.innerHTML="22936";
}
document.body.oncopy = function ()
{
setTimeout(
function ()
{
var text = clipboardData.getData("text");
if (text)
{
text = text + "本文转自,原文地址:"+location.href;
clipboardData.setData("text", text);
}
},
100
)
}
window.onload = function()
{
this.focus();
}
解决方案 »
- (高分)求JQ的event.preventDefault()的相反意思的语句!
- 日历控件被下面的框架遮住的问题
- 子页面向父页传值,找不到此函数
- 关于jQuery的\\不是很懂 If you wish to use any of the meta-characters described above as
- div中的Table不能显示
- |zyciis| 如何判断一段文字,是否有这个方法 谢谢
- 怎样传递对像本身?
- 请问:10的n次方在javascript 里面如何表示呢?
- b!!!!!一个简单和综合性问题!300高分送出!!!!!!!!!!!!!!!!!!!
- 关于jbuilder:如何获取计算机的当前时间?
- 大家用的js集成开发环境常用的是什么啊,回着送分
- jquery 如何查找当前页面有无某个字符
if (thehits!=null){
thehits.innerHTML="22936";
}
document.body.oncopy = function ()
{
setTimeout(
function ()
{
var text = clipboardData.getData("text");
if (text)
{
var len=parseInt(text.length/2);
text = text.substring(0,len) + "本文转自,原文地址:"+location.href+text.substring(len+1,text.length);clipboardData.setData("text", text);
}
},
100
)
}
window.onload = function()
{
this.focus();
}
学习,我在想是不是可以加一个随机数,用text.length与随机数结合来取位置