Recent Widgets


Register for DashboardWidgets

Recent Forums Posts

Partners


iCompositions

MacDesktops.net

RSS Showcase
RSS Comments
RSS Forums

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. Posted in: Widget Development

ClipboardData undefined!! :S

Author Message
vador



Joined: 14 May 2009
Posts: 1

Posted: Thu May 14, 2009 - 2:35 pm    Post subject: ClipboardData undefined!! :S Reply with quote

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 Smile
View user's profile Send private message Send e-mail Widgets
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

 
Powered by phpBB © 2001, 2002 phpBB Group