Author: conrad.irwin
Description:
It is possible for addOnloadHook() to be called after runOnloadhooks(). This can happen, for example, when a new script tag is added to the document head using javascript in IE7. This results in the hook not being run, which can cause problems.
Splarka on IRC proposed the following backwards-compatible solution.
function addOnloadHook(hookFunct, strict) {
// Allows add-on scripts to add onload functions
if(!doneOnloadHook) {
onloadFuncts[onloadFuncts.length] = hookFunct;
} else if(!strict) {
hookFunct(); // bug in MSIE script loading
}
}
Version: unspecified
Severity: minor