You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The window.onload function is overwritten to hidePutCode, but this is potentially problematic if there was already other window.onload functions registered, as was the case in my repository.
The safer way is to ADD the function, rather than overwrite.
Here is how I do that:
function addWindowOnLoad(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
}
else {
window.onload = function () {
if (oldonload) {
oldonload();
}
func();
}
}
}
addWindowOnLoad(hidePutcode);
This ensures that hidePutcode is added to any existing window.onload functions, if they are already some defined. I recommend this safer way of doing it.
The text was updated successfully, but these errors were encountered:
In this line:
orcid_support_advance/lib/static/javascript/auto/90_orcid_support_advance.js
Line 29 in 27e44e3
The window.onload function is overwritten to hidePutCode, but this is potentially problematic if there was already other window.onload functions registered, as was the case in my repository.
The safer way is to ADD the function, rather than overwrite.
Here is how I do that:
This ensures that hidePutcode is added to any existing window.onload functions, if they are already some defined. I recommend this safer way of doing it.
The text was updated successfully, but these errors were encountered: