使用javascript剪贴板粘贴 [英] Clipboard paste using javascript

查看:110
本文介绍了使用javascript剪贴板粘贴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我的应用程序中使用iframe动态创建的编辑器具有剪切复制和粘贴选项。除粘贴外,所有选项都正常工作。我使用以下代码进行粘贴



eval(''frame1'')。document.execCommand(''paste'');



请帮帮我。



谢谢,

解决方案

假设iframe中有一个文本框,这样的东西应该可以工作:



  eval '  frame1')。 document  .Form1.txtArea.focus(); 
PastedText = eval ' frame1'). document .Form1.txtArea.createTextRange();
PastedText.execCommand( 粘贴);


Hi,

I have a dynamically created editor using iframe in my application having cut copy and paste options. All options are working fine except the paste. I am using the following code for paste

eval(''frame1'').document.execCommand(''paste'');

Please help me in this.

Thanks,

解决方案

Assuming there is a textbox inside that iframe, something like this should work:

eval('frame1').document.Form1.txtArea.focus();
PastedText = eval('frame1').document.Form1.txtArea.createTextRange();
PastedText.execCommand("Paste");


这篇关于使用javascript剪贴板粘贴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆