Get the URL address of this page three JS code

Source: Internet
Author: User
Tags copy
js| page Code One:

<script>
function Selecturl () {
Z=document.body.createtextrange ();
Z.movetoelementtext (SELECTURLDIV);
Z.select ();
}
</script>
<span onmousemove= ' Selecturl () ' Id=selecturldiv><script>document.write (location.href) </script>


Code two:

<script>
function Copycode (o) {o.select (); var js=o.createtextrange (); Js.execcommand ("copy"); alert ("Copy succeeded!") ");}
document.write ("<table align=center class=tableborder1 cellpadding=1 cellspacing=0><tr>");
document.write ("<td width=10% nowrap class=tablebody1> page URL address (double click copy):</td>");
document.write ("<td class=tablebody1><textarea onfocus=this.select () style= ' width:100%;overflow-y": Visible ' Ondblclick=copycode (this) rows=1> ");
document.write (self.location+ "</textarea></td></tr></table>");
</script>


Code Three:

<script language= "JavaScript" >

<!--

function CopyToClipboard () {

var clipboardcontent=document.location;

clipboardcontent+= ' \ r \ n ';

Window.clipboardData.setData ("Text", clipboardcontent);

Alert ("Yes!") Copy success! You can paste in the QQ message to your good friend! Thanks again for your support for {Theblogtitle}! ");

}

-->

</script>

<script language= ' JavaScript ' >

document.write ("
document.write ("<input size=\" 60\ "value=\" "+document.location+" \ "><input type=\" button\ "value=\" recommended to friends \ " Title=\ "Click the Copy Address to the Clipboard, paste directly on the msn/qq." Onclick=\ "CopyToClipboard () \" > ");

</script>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.