Browse Source

feat(index.html): post load error handler

Adds a placeholder which allows to write a plugin for executing some
code after the "load error handler" is triggered. A function named
"postLoadErrorHandler" should be defined in one of
the "#include virtual" files.
master
paweldomas 8 years ago
parent
commit
4fa800b87a
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      index.html

+ 5
- 0
index.html View File

113
 
113
 
114
                     window.setTimeout(
114
                     window.setTimeout(
115
                         function () { window.location.replace(href); }, delay);
115
                         function () { window.location.replace(href); }, delay);
116
+
117
+                    // Call extra handler if defined.
118
+                    if (typeof postLoadErrorHandler === "function") {
119
+                        postLoadErrorHandler();
120
+                    }
116
                 };
121
                 };
117
                 window.removeEventListener(
122
                 window.removeEventListener(
118
                     'error', loadErrHandler, true /* capture phase */);
123
                     'error', loadErrHandler, true /* capture phase */);

Loading…
Cancel
Save