A problem of onload and onresize in Chrome's BOM event

first code
window.onload = function () {

...//

}

window.onresize = function () {

...//

}

second code
function checkInBL () {

...//

}

window.onload = checkInBL ();

window.onresize = checkInBL ();

the first piece of code is completely normal, and the second piece of code can be triggered normally only by onload, but not by onresize. Why?

Apr.07,2021

window.onload = checkInBL;
window.onresize = checkInBL;

in the first section of code, you assign both window.onload and onresize functions. In the second section of code, you assign the return value of checkInBL after the function is called (God knows what you return). I guess you want to set it to checkInBL directly.

window.onload = checkInBL;
window.onresize = checkInBL;
Menu