1
/*
2
* Multiple onload events
3
* By Simon Willison
4
* http://simonwillison.net/2004/May/26/addLoadEvent/
5
*
6
*/
7
function addLoadEvent(func) {
8
var oldonload = window.onload;
9
if (typeof window.onload != 'function') {
10
window.onload = func;
11
}
12
else {
13
window.onload = function() {
14
if (oldonload) {
15
oldonload();
16
}
17
18
func();
19
}
20
21
}
22
23
}