欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

js實現(xiàn)的復(fù)制兼容chrome和IE

 更新時間:2014年04月03日 15:33:17   作者:  
這篇文章主要介紹了js在chrome和IE下分別實現(xiàn)復(fù)制,需要的朋友可以參考下
IE js代碼:
復(fù)制代碼 代碼如下:

<script type="text/javascript">
function copyUrl2()
{
var Url2=document.getElementById("biao1");
Url2.select(); // 選擇對象
document.execCommand("Copy"); // 執(zhí)行瀏覽器復(fù)制命令
alert("已復(fù)制好,可貼粘。");
}
</script>
<textarea cols="20" rows="10" id="biao1">用戶定義的代碼區(qū)域</textarea>
<input type="button" onClick="copyUrl2()" value="點(diǎn)擊復(fù)制代碼" />

chrome JS代碼:
復(fù)制代碼 代碼如下:

<script src="http://www.weicaiyun.com/assets/js/copy/ZeroClipboard.js"></script>

<script type="text/javascript">

var clip = new ZeroClipboard.Client();
clip.setHandCursor( true );
clip.setText('復(fù)制內(nèi)容');
clip.glue('button');

</script>

<input type="button" id="button" value="點(diǎn)擊復(fù)制代碼" />
您可能感興趣的文章:

相關(guān)文章

最新評論