PS: Preliminary discovery is that it is a browser compatibility issue. Only IE supports clipboardData. So the question is, is there a better method?
Problem description:
global.html There is an iframe with "id=biao1". Now I want to extract the text content of the p tag in the iframe through js and copy it to the clipboard. In this example, I want to use the clipboardData.setData method and If the following error message appears, please give me some advice.
Error message:
1 2 3 4 |
|
global.html Main source code
1 2 3 4 |
|
zhiliangbaobiao main source code
1 2 3 4 |
|
仅有的幸福2017-06-24 09:46:00
You can use the clipboard.js library (pay attention to browser compatibility) or directly use Flash.