Javascript examples for Browser Object Model:Window Load
Add two functions to window.onload
<html> <head></head> <body> <script> Function.prototype.extend = function(fn) { var self = this;//w w w.j av a 2s . c o m return function(){ self.apply(this, arguments); fn.apply(this, arguments); }; }; window.onload = function() { console.log('foo'); }; window.onload = window.onload.extend(function() { console.log('bar'); }); </script> </body> </html>