CopyPastor

Detecting plagiarism made easy.

Score: 0.815772533416748; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2018-11-19
by An Nguyen

Original Post

Original - Posted on 2016-07-07
by Nikunj Dhimar



            
Present in both answers; Present only in the new answer; Present only in the old answer;

function copyToClipboard(id) { var text = $("#td_id_" + id).text(); //getting the text from that particular Row //window.prompt("Copy to clipboard: Ctrl+C, Enter", text); if (window.clipboardData && window.clipboardData.setData) { // IE specific code path to prevent textarea being shown while dialog is visible. return clipboardData.setData("Text", text); } else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { var textarea = document.createElement("textarea"); textarea.textContent = text; textarea.style.position = "fixed"; // Prevent scrolling to bottom of page in MS Edge. document.body.appendChild(textarea); textarea.select(); try { return document.execCommand("copy"); // Security exception may be thrown by some browsers. } catch (ex) { console.warn("Copy to clipboard failed.", ex); return false; } finally { document.body.removeChild(textarea); } }
Here is the function which might can help you or future referer.
function copyToClipboard(id) { var text = $("#td_id_" + id).text(); //getting the text from that particular Row //window.prompt("Copy to clipboard: Ctrl+C, Enter", text); if (window.clipboardData && window.clipboardData.setData) { // IE specific code path to prevent textarea being shown while dialog is visible. return clipboardData.setData("Text", text); } else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { var textarea = document.createElement("textarea"); textarea.textContent = text; textarea.style.position = "fixed"; // Prevent scrolling to bottom of page in MS Edge. document.body.appendChild(textarea); textarea.select(); try { return document.execCommand("copy"); // Security exception may be thrown by some browsers. } catch (ex) { console.warn("Copy to clipboard failed.", ex); return false; } finally { document.body.removeChild(textarea); } } }
Unit test in all Browser not done.

        
Present in both answers; Present only in the new answer; Present only in the old answer;