获得当前页面URL地址的三个JS代码
获得当前页面URL地址的三个JS代码
发布时间:2015-11-04 来源:查字典编辑
摘要:码一:scriptfunctionselecturl(){z=document.body.createTextRange();z.moveT...

码一:

script

function selecturl(){

z=document.body.createTextRange();

z.moveToElementText(selecturlP);

z.select();

}

/script

span onmousemove='selecturl()' id=selecturlPscriptdocument.write(location.href)/script

代码二:

script

function copyCode(o){o.select();var js=o.createTextRange();js.execCommand("Copy");alert("复制成功!");}

document.write("table align=center class=tableborder1 cellpadding=1 cellspacing=0tr

document.write("td width=10% nowrap class=tablebody1本页URL地址(双击复制):");

document.write("td class=tablebody1textarea onfocus=this.select() ondblclick=copyCode(this) rows=1

document.write(self.location+"/textarea/td/tr/table

/script

代码三:

script language="javascript"

/script

script language='javascript'

document.write("img src="templates/{TemplateName}/images/db.gif" width="49" height="17"

document.write("input size="60" value=""+document.location+""input type="button" value="推荐给朋友" onclick="copyToClipBoard()"

/script

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新Javascript教程学习
热门Javascript教程学习
编程开发子分类