根據 http://en.wikipedia.org/wiki/DOM_events 的說明
Two major types of events are added by Microsoft, and in some cases can only be used in Internet Explorer. Others have been implemented as de-facto standards by other browsers.
- Clipboard events
- Data binding events
Microsoft在自家的ie瀏覽器上,多自訂了以上兩種類型的事件,其中oncopy, onpaste這兩個,上週發現Firefox 3.6, Chrome 6都也可以支援。
document.getElementById(ElementID).addEventListener(eventType, fn);
eventType為'copy' 或是'paste', fn為function.
雖然不是W3C的規格,但這個監視剪貼簿的事件真的不錯用,省去監視keyup/keypress/keydown或是按滑鼠右鍵複製貼上這些實作。
沒有留言:
張貼留言