Created
October 7, 2014 18:00
-
-
Save shamasis/8148ccc83e77782cc569 to your computer and use it in GitHub Desktop.
Library function to procure text form of clipboard data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getClipboardDataAsText = (function () { | |
if (window.clipboardData && window.clipboardData.getData) { // Browsers with global handler | |
return function () { | |
return window.clipboardData.getData('Text') || E; | |
}; | |
} | |
// For event specific paste supported browsers | |
return function (referenceEvent) { | |
return e.clipboardData && e.clipboardData.getData && e.clipboardData.getData('text/plain') || E; | |
}; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment