<kr**********@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi,
I've searched dozens of forums and websites to find a way to have
javascript copy an image I click on into the clipboard of windows. I
found a few examples but I couldn't get any of them to work either
getting object doesnt support this method or other errors I don't
understand. If anyone has any working code for this I'd be very
thankful for it.
And yes, I know this only works in IE and I'm assuming that the user
will be using windows.
Well... just because they're using Windows doesn't mean they're using IE
(and just because they're using IE doesn't actually mean they're using
Windows). ;^)
But anyways...
I don't believe you can, via script, copy an image. The scriptable
clipboardData element in IE only supports text (and "url" which isn't
helpful to you either). It can't copy binary data.
Using the scriptable element like this:
if ( window.clipboardData ) {
window.clipboardData.setData("Text", "Text to copy.");
};
You could copy the URL to the image, the name of the image or any other
textual information you like about it - but not the actual image.
Jim Davis