Javascript examples for Function:Function Definition
Insert scripts into an existing function
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {/*from w w w. ja va2 s. co m*/ var cool = { lol: function() { console.log("test"); } } var ori = cool.lol; cool.lol = function() { ori(); console.log('my test'); } cool.lol(); }); </script> </head> <body> </body> </html>