Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add addLoadEvent function

  • Loading branch information...
commit 62d4194c344065ea63d32a68fb8dd09d5eb5bc46 1 parent f54c27c
rmagick authored
Showing with 14 additions and 1 deletion.
  1. +14 −1 doc/scripts/doc.js
View
15 doc/scripts/doc.js
@@ -1,4 +1,3 @@
-
// Show an example script in a popup window
function popup(URL) {
day = new Date();
@@ -6,4 +5,18 @@ function popup(URL) {
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();
+ }
+ }
+}
+
Please sign in to comment.
Something went wrong with that request. Please try again.