点击按钮,实现复制网址的代码

<iframe name="google_ads_frame" marginwidth="0" marginheight="0" src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-4490194096475053&amp;dt=1228587520953&amp;lmt=1228528466&amp;prev_slotnames=1891601125&amp;output=html&amp;slotname=3685991503&amp;correlator=1228587520921&amp;url=http%3A%2F%2Fwww.corange.cn%2Farchives%2F2008%2F10%2F1843.html&amp;ea=0&amp;ref=http%3A%2F%2Fwww.corange.cn%2Fhtml%2Fcorange__96.html&amp;frm=0&amp;ga_vid=84592235.1228587521&amp;ga_sid=1228587521&amp;ga_hid=747581118&amp;flash=9.0.124.0&amp;u_h=768&amp;u_w=1024&amp;u_ah=738&amp;u_aw=1024&amp;u_cd=32&amp;u_tz=480&amp;u_java=true&amp;dtd=15" frameborder="0" width="300" scrolling="no" height="250" allowtransparency></iframe>
按钮代码:



<button onclick="copyToClipBoard()">复制本贴地址发送给好朋友</button>

调用函数



<script language="javascript">
function copyToClipBoard(){
var clipBoardContent="";
clipBoardContent+=document.URL
window.clipboardData.setData("Text",clipBoardContent);
alert("复制成功");
}
</script>

你可能感兴趣的:(JavaScript,html,.net,Google,Flash)