Hi I am trying to develop/upgrade a non-flash based copy to clipboard functionality for modern browsers from flash based zeroClipboard plugin in which I stomp on the document.execCommand("Copy")
functionality, the problem is I already created the execCommand but I have no idea on how the fallback will be implemented for this. here is my code:
<textarea id="input">Some text to copy.</textarea>
<button id="copy-button">Copy</button>
<script>
var input = document.getElementById("input-account");
var button = document.getElementById("copy-button");
button.addEventListener("click", function (event) {
event.preventDefault();
input.select();
document.execCommand("copy");
});
</script>
Do you have any idea on how can I implement a flash based fallback for this one?
here is my old code for zeroclipboard:
$("#copy-button").zclip({
path: baseUrl + '/assets/js/ZeroClipboard.swf',
copy: $("#input-account").val(),
afterCopy: function() {
//do nothing;
}
});