Chrome complains when I try copyinside setTimeout.
setTimeout(function () { copy('a') }, 0)
Uncaught ReferenceError: copy is not defined
at <anonymous>:1:26
It also does not work with the area window.
setTimeout(function () { window.copy('a') }, 0)
Uncaught TypeError: window.copy is not a function
Interestingly, if I keep the link to copyand reuse it, it works
cc = copy;
setTimeout(function () { cc('a') }, 0);
In Firefox, it does not cause any errors, but it does not work even with a saved link.
Why the function copydoes not work inside setTimeout, is this an error?
source
share