Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Not all browsers support programmatic access to the clipboard (Firefox).
- if (aras.utils.isClipboardSupported())
- {
- copyToBuffer(buffer);
- return alert("Item(s) copied.");
- }
- else
- {
- // If clipboard access is not supported, print the result in an alert
- // and tell the user to copy contents with Ctrl+C.
- return alert("Browser does not allow clipboard access. Please use Ctrl+C to copy:\n\n" + buffer);
- }
- // copyToBuffer function
- // takes a string & writes it to the clipboard
- function copyToBuffer(buffer) {
- if (window.clipboardData) {
- window.clipboardData.setData('Text', buffer);
- } else {
- aras.utils.setClipboardData('Text', buffer, window);
- }
- }
Add Comment
Please, Sign In to add comment