您的位置:首页 > 编程语言 > ASP

asp.net [分享] js获取复制本页地址 编辑:吴立星

2016-11-17 17:37 351 查看
JS获取复制本页地址 

<input type="button" name="Submit2"> 

<script language="javascript"> 

function copyToClipBoard(){ 

var clipBoardContent=""; 

clipBoardContent+=document.title; 
clipBoardContent+="\n"; 

 clipBoardContent+=this.location.href; //获取地址 

 window.clipboardData.setData("Text",clipBoardConte nt); 

alert("复制成功"); 

 } 

 document.write( this.location.href); //显示地址 

</script> 

<input type="button" name="Submit2"> 

<script language="javascript"> 

function copyToClipBoard(){ 

var clipBoardContent=""; 

clipBoardContent+=document.title; 

clipBoardContent+="\n"; 

clipBoardContent+=this.location.href; //获取地址 

window.clipboardData.setData("Text",clipBoardConte nt); 

alert("复制成功"); 



document.write( this.location.href); //显示地址 

</script> 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: