modify insertBefore
<p>Is there any way that I can replace the insertBefore and similar with my own functions. My aim is to implement an undo feature and if I'm able to implement it this way, I wont have to change each instance of insertBefore in my code with my function name and it would also make the further development easier.</p>

<p>I've found something similar here <a href="http://stackoverflow.com/questions/4343255/disable-a-built-in-function-in-javascript-alert">Disable a built-in function in javascript (alert)</a> but am not able to figure out how to use it in my case because I dont know who is the parent of these functions (insertBefore,appendChild etc). </p>

<p>I just want to insert one line of my code and then call the native code.</p>

<p>Please advise</p>

<p>PS. I'm trying to implement an undo functionality and this library requires me to register an undo in that undo-function for allowing redo. So all I want to do is make that a single line of code is always executed before any insertBefore and similar functions.</p>

<p>I'm not talking about any libraries, but just the plain ECMAscript.</p>
