Is there an event that occurs after paste? [duplicate]
Possible Duplicate:
Detect pasted text with ctrl+v or right click -> paste
I'm coding a js editor now. I want to do something (detect pasted text, etc.) just after the paste.
Here's an example of handling paste event:
http://www.quirksmode.org/dom/events/tests/cutcopypaste.html
It's supported on many browsers but not 100% - see this table for compatibility: http://www.quirksmode.org/dom/events/cutcopypaste.html
You can also work around not having a paste event on some browsers by:
Remembering full contents of the form field at some time
Setting a timeout event
On timeout, take the contents of the field again, compare to the previous contents, and detect changes. Lather, rinse, repeat
精彩评论