473,320 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Getting the clipboard content from Notepad to the html page

Hi
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).
Thanks,
Zana
Oct 5 '05 #1
3 2257
acoder
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
  1.  
  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
  7.  
  8.  
Apr 6 '08 #3
acoder
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

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

Similar topics

7
by: Wayne Wengert | last post by:
I have an ASP page in which I want to copy the contents of a variable (text) to the clipboard. Based on MSDN examples I tried window.clipboardData.setData(strTemp) and that generates an error...
5
by: TC | last post by:
Hello, I am familiar with obtaining source file reference material from the system clipboard using the old Win32 API. For example, copy an Excel chart onto the clipboard and goto Word. Under,...
5
by: TC | last post by:
Hello, Here is what I'm trying to do: -- Make sure both MS Excel and MS Word are running -- Create an Excel chart -- Save the Excel file -- Copy the Excel chart onto the clipboard using Ctrl...
5
by: J | last post by:
Hi All, I have a quick question, I am making a little script that shows users how easy it is to have there clipboards read. I would like to capture my users clipboard (plain text only) and then...
16
by: ad | last post by:
Hi, How can we get the content of clipboard with program?
1
by: Figmo | last post by:
Wow.....this is darned odd.... I have an app that integrates with other applications. It registers a global hotkey with Windows. When the hotkey executes it sends a CTRL-C to the active...
2
by: toronto | last post by:
Seasons Greetings Everyone! I want to use JavaScript's event object to detect whether someone has pressed the 'PrintScreen' key to screenshot, via the Windows Clipboard, and to print website...
0
by: Keith G Hicks | last post by:
asp.net 2.0 Well until I started looking for how to do this I figured it would be very easy and lots of information out there. Maybe I'm not looking in the right places. I have some code in...
6
by: Adam Sandler | last post by:
Hello, I have a richtextbox and a method which copies the contents of the richtextbox to the clipboard -- like so: Clipboard.SetText(this.richTextBox1.Text); The problem is if there are any...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.