JS 紀事
1.
function doCopy() {
???textRange = test.createTextRange();
???textRange.execCommand("Copy");
}
function doPaste() {
???textRange = taCode.createTextRange();
???textRange.execCommand("Paste");
}?
2.
?<script language="javascript">
function readTxt()
{
??? alert(window.clipboardData.getData("text"));
}
function setTxt()
{
??? var t=document.getElementById("txt");
??? t.select();
??? window.clipboardData.setData('text',t.createTextRange().text);
}
</script>
<input name="txt" value="輸入測試">
<input type="button" value="復制" onclick="setTxt()">
<input type="button" value="讀取" onclick="readTxt()">
window.clipboardData.clearData();?
即可破解右鍵限制:javascript:void(document.body.oncontextmenu='',document.oncontextmenu='');
posted on 2010-01-04 14:04 飛熊 閱讀(190) 評論(0) 編輯 收藏 所屬分類: Javascript