小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

用flash javascript實(shí)現(xiàn)網(wǎng)頁中復(fù)制數(shù)據(jù)功能 - WEB標(biāo)準(zhǔn)網(wǎng)站設(shè)計(jì)心得 - ...

 rgb 2007-04-24
經(jīng)常在網(wǎng)頁上看見“復(fù)制本頁網(wǎng)址,給你的朋友分享”之類的話,點(diǎn)按鈕,在IE下能復(fù)制成功,而在firefox和opera等其他瀏覽器就不行
下面的例子使用flash(as)+javascript實(shí)現(xiàn)了在不同瀏覽器里復(fù)制的功能,這樣做的好處就是規(guī)避了瀏覽器兼容的問題。也就是說支持firefox,IE,OPERA

看演示:用firefox和ie分別測(cè)試
點(diǎn)這個(gè)頁面最下面的復(fù)制按鈕,然后粘貼在QQ,或者M(jìn)SN等文本框內(nèi)

怎樣使用?
1.先下載這個(gè)FLASH文件:下載,右鍵另存

2.代碼如下:
<html>
<head>

<title>用flash+javscript實(shí)現(xiàn)網(wǎng)頁上的文本復(fù)制</title>

</head>
<body>
<script type="text/javascript" language="javascript">
function copyit(textit) {
if (window.clipboardData) {
window.clipboardData.setData("Text",textit);
} else {

var flashcopier = ‘flashcopier‘;
if(!document.getElementById(flashcopier)) {
var divholder = document.createElement(‘div‘);
divholder.id = flashcopier;
document.body.appendChild(divholder);
}
document.getElementById(flashcopier).innerHTML = ‘‘;
var divinfo = ‘<embed src="_clipboard.swf" FlashVars="clipboard=‘+textit+‘" width="0" height="0" type="application/x-shockwave-flash"></embed>‘;
document.getElementById(flashcopier).innerHTML = divinfo;
}
}
//copyit("")

</script>
<input type="text" value="用flash+javscript實(shí)現(xiàn)網(wǎng)頁上的文本復(fù)制" id="g">
<a href="javascript:copyit(document.getElementById(‘g‘).value);">復(fù)制一下</a>
</body>
</html>

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多