469,613 Members | 1,355 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,613 developers. It's quick & easy.

Getting the clipboard content from Notepad to the html page

How can I get the clipboard content from Notepad to my page ?(For pasting I use the dhtml method document.execCommand('Paste', true, null) and it works fine - but I need the clipboard content without calling "Paste" option).
Oct 5 '05 #1
3 2188
16,027 Expert Mod 8TB
If it works (though probably only in IE), not sure why you'd want an alternative.
Apr 5 '08 #2
rnd me
427 Expert 256MB
the firefox version is a lot longer, and requires a user-change to about.config, let me know if you want it.

Expand|Select|Wrap|Line Numbers
  2. function CB() //sets or read clipboard in IE accepts 1 arg to set, returns cb when no argument is passed
  3. {
  4. if (arguments.length)     {window.clipboardData.setData('Text', arguments[0])}
  5. else     { return window.clipboardData.getData('Text')}
  6.  }//end CB
Apr 6 '08 #3
16,027 Expert Mod 8TB
True, Firefox does have that option and that's the way it should be - up to the user if they want to allow JavaScript access to the clipboard. You could always inform your users how to enable it and then the choice is theirs.
Apr 7 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Wayne Wengert | last post: by
16 posts views Thread by ad | last post: by
2 posts views Thread by toronto | last post: by
6 posts views Thread by Adam Sandler | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.