vador
Joined: 14 May 2009 Posts: 1
|
| Posted: Thu May 14, 2009 - 2:35 pm Post subject: ClipboardData undefined!! :S |
|
|
Hi everyone,
I am new to this forum and to the widgets development. I want to congratulate the community for this great open space.
My problem is fairly simple to explain: I have a button that I named "copy", it as active the onclick event to a handler named "doCopy".
Here is the doCopy function:
function doCopy(event) {
// Values you provide
var dataForPasteboard = document.getElementById("result").innerText;
// Copy code
event.clipboardData.setData('text/plain', dataForPasteboard);
event.preventDefault();
event.stopPropagation();
}
But the Event received (a MouseEvent) as the variable clipboardData UNDEFINED.
And so it breaks on the event.clipboardData.setData('text/plain', dataForPasteboard);
How can I create a clipboardData object so I can copy the content from the result variable???
Thanks  |
|