I use window.onload in the my script which contains other call functions
window.onload = function() {
maxHeight_main_column();
...
}
and added my script in the head tag
In the body I added new script from other site which uses window.onload again, and my window.onload works good but second window.onload doesn’t work, how I can resolve this problem?
I can’t edit second file with window.onlad
There can only be one function assigned to
window.onload. But, you can have multiple event listeners that listen to that same event.See the MDN doc on addEventListener for more details.
In your specific case, you can use this code for your onload handler and let the other one use
window.onload: