Connecting Tech Pros Worldwide Forums | Help | Site Map

copy to clipboard

Manuel
Guest
 
Posts: n/a
#1: Jul 23 '05
hello everyone

in my website i use the methods ".execCommand('SelectAll')" and
".execCommand('Copy')" to copy a defined area to the clipboard, that works
fine, but now i wanted to make my website compatible with macintosh.

the same functions dont work on a mac, so i am asking if anyone knows how
the "copy to clipboard" function (for text and images!) works on macintosh
or if it works at all on a mac.

thank you very much

Manuel from Switzerland



Martin Honnen
Guest
 
Posts: n/a
#2: Jul 23 '05

re: copy to clipboard




Manuel wrote:

[color=blue]
> in my website i use the methods ".execCommand('SelectAll')" and
> ".execCommand('Copy')" to copy a defined area to the clipboard, that works
> fine, but now i wanted to make my website compatible with macintosh.[/color]

execCommand is IE/Win only I think (unless you want to use it in an
editable iframe where Mozilla since 1.4 supports it too) so it is not
Macintosh that is the problem but simply it depends on whether the
browser supports the API document.execCommand.
[color=blue]
> the same functions dont work on a mac, so i am asking if anyone knows how
> the "copy to clipboard" function (for text and images!) works on macintosh
> or if it works at all on a mac.[/color]

I don't think any browser but IE/Win supports execCommand and I doubt
any browser besides IE/Win does expose the clipboard to unprivileged
script. I am pretty sure neither Opera nor Mozilla provide clipboard
access, I only know about the Windows versions but as both produce
cross-platform browsers I don't think their Mac versions differ.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Closed Thread


Similar JavaScript / Ajax / DHTML bytes