Javascript examples for Object:prototype
Hijacking DOM manipulations
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//w ww . ja v a2 s . c o m var el = document.getElementsByTagName('audio')[0]; Object.defineProperty(el, 'src', { set: function (newSrc) { console.log('they set src to ' + newSrc); } }); el.src = 'http://example.com/sounds.mp3'; } </script> </head> <body> <audio></audio> </body> </html>