Permalink
Browse files

add addLoadEvent function

  • Loading branch information...
rmagick
rmagick committed Aug 27, 2006
1 parent f54c27c commit 62d4194c344065ea63d32a68fb8dd09d5eb5bc46
Showing with 14 additions and 1 deletion.
  1. +14 −1 doc/scripts/doc.js
View
@@ -1,9 +1,22 @@
-
// Show an example script in a popup window
function popup(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1');");
}
+// Run a function on window onload event
+function addLoadEvent(func) {
+ var oldonload = window.onload;
+ if (typeof window.onload != 'function') {
+ window.onload = func;
+ }
+ else {
+ window.onload = function () {
+ oldonload();
+ func();
+ }
+ }
+}
+

0 comments on commit 62d4194

Please sign in to comment.