1 2 3 4 5 6 7 8 9 10 11 12 13 14
<html> <head> <script> function loaded() { var node = document; var handler = function(operation, key, data, src, dst) { alert(data); }; node.setUserData("foo", "data", handler); } </script> </head> <body onload="loaded();"> <div id="elem"></div> </body> </html>