Skip to content

Instantly share code, notes, and snippets.

@dhunmoon
Last active September 24, 2015 07:31
Show Gist options
  • Save dhunmoon/2bbd7107223646897fe5 to your computer and use it in GitHub Desktop.
Save dhunmoon/2bbd7107223646897fe5 to your computer and use it in GitHub Desktop.
JS: alert function override
(function() {
var _alert = window.alert; // <-- Reference
window.alert = function(str) {
// do something additional
if(console) console.log(str);
//return _alert.apply(this, arguments); // <-- The universal method
// Suits for this case
};
})();
alert("This");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment