Why is my 'load' event/function not beeing executed after switching to jQuery 3?
问题 Since I\'ve upgraded from jQuery 1.x / jQuery 2.x to jQuery 3.x , my existing code will not be executed correctly anymore. Everything works fine, but the load event listener gets not triggered anymore or just sometimes: $(function() { $(window).on(\"load\", function() { // this line will never/occasionally be executed console.log(\"window is loaded!\"); }); }); 回答1: The problem can be occur when using/switching to jQuery 3 . It's because all ready states in the new jQuery 3 are now fully