我稍微改造了一下!
<script language="JavaScript">
<!--
function copyLink () {
var links = document.title +location.href;
window.clipboardData.setData("Text",links);
alert("该网页地址已复制,您可以在QQ,MSN中粘贴(快截键CTRL+V)推荐给好友");
}
function copyTitle () {
var links = document.title;
window.clipboardData.setData("Text",links);
alert("该网页地址已复制,您可以在QQ,MSN中粘贴(快截键CTRL+V)推荐给好友");
}
function copyURL () {
var url = location.href;
window.clipboardData.setData("Text",url);
alert("该网页链接地址已复制,您可以粘贴(快截键CTRL+V)在需要的地方");
}
-->
</script>
<div><A href="javascript:copyTitle();" target="_parent">仅复制标题</a></div>
<div><A href="javascript:copyURL();" target="_parent">仅复制链接</a></div>
<div><A href="javascript:copyLink();" target="_parent">复制链接和标题</a></div>
<div onmousedown="javascript:copyLink();" style="width:650px; height:25px; border:#CCCCCC 1px solid; background-color:#FFFFFF;" title="点击复制此文章给好友"><script language="JavaScript">document.write(""+window.location.href+" ");</script></div>