碼一:
<script>
function selecturl(){
z=document.body.createTextRange();
z.moveToElementText(selecturlP);
z.select();
}
</script>
<span onmousemove='selecturl()' id=selecturlP><script>document.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=0><tr>");
document.write("<td width=10% nowrap class=tablebody1>本頁URL地址(雙擊復制):</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>
代碼三: <script language="javascript">
<!--
function copyToClipBoard(){
var clipBoardContent=document.location;
clipBoardContent+='\r\n';
window.clipboardData.setData("Text",clipBoardContent);
alert("耶!復制成功喽!你可以粘貼在QQ消息裡送給你的好朋友呀!再次感謝你對 {TheBlogTitle} 的支持哦!");
}
//-->
</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>