Skip to content

Instantly share code, notes, and snippets.

@ismyrnow
Created February 8, 2012 18:07
Show Gist options
  • Save ismyrnow/1771836 to your computer and use it in GitHub Desktop.
Save ismyrnow/1771836 to your computer and use it in GitHub Desktop.
Overriding a global function in JS
// Overrides "some_function"
some_function = function () {
var orig_function = some_function;
return function () {
// call the original function
orig_function.apply(this, arguments);
// do other stuff
};
} ();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment