I researched how to override the alert method using the Proxy Pattern design pattern in jQuery, so here’s a memo.
(function() {
var proxied = window.alert;
window.alert = function() {
// Add processing here
return proxied.apply(this, arguments);
};
})();
That’s all.
・Types - jQuery JavaScript Library
・override - JavaScript: Overriding alert() - Stack Overflow
・必殺の .apply()フックを打つべし! 打つべし!(JavaScript おれおれ Advent Calendar 2011 – 17日目) | Ginpen.com
That’s all from the Gemba.