Im trying to copy to clipboard the return result from ajax but every time i get "document.execCommand(‘cut’/‘copy’) was denied" i try few time to fix it but without success
$('form').submit(function(e){
e.preventDefault();
$.ajax({
url: $('#test').attr('action'),
data: $('#test').serialize(),
type: 'post',
dataType: 'json',
success: function(data){
var $temp = $("<input />");
$(data.response).append($temp).select();
document.execCommand("copy");
$temp.remove();
console.log(data.response);
}
});
});