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 飞熊 阅读(170) 评论(0)  编辑  收藏 所属分类: Javascript


只有注册用户登录后才能发表评论。


网站导航:
 
<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

导航

统计

常用链接

留言簿(1)

随笔分类

随笔档案

文章分类

文章档案

收藏夹

搜索

最新评论

阅读排行榜

评论排行榜