I make a small web application that retrieve data and my clients copy information in the web page and paste data in excel
the problem is that copied data contains "html" elements about style or i don't know what and if users make a basic copy/paste it block macro in the excel document
If they copy data and paste in a notepad, re-copy and paste it will work, because, it remove unwanted data
searching on the internet, I found that, but it does not do what I want,
the idea is that when an user copy data the javascript "clean" the copied text and then no more issue
Delete text from copied text
How do you handle oncut, oncopy, and onpaste in jQuery?
http://www.ht开发者_开发百科mlgoodies.com/beyond/javascript/article.php/3458851/Click-Its-Copied.htm
You could put the text into the inner text of a <textarea>
tag. Then, no formatting information will follow text when it's copied.
<textarea rows="4" cols="40">
Text to be copied.
</textarea>
精彩评论