jquery-3

Why is my 'load' event/function not beeing executed after switching to jQuery 3?

纵饮孤独 提交于 2019-11-26 09:55:24
问题 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

jquery 3.0 url.indexOf error

最后都变了- 提交于 2019-11-26 06:59:03
问题 I am getting following error from jQuery once it has been updated to v3.0.0 . jquery.js:9612 Uncaught TypeError: url.indexOf is not a function Any Idea why? 回答1: Update all your code that calls load function like, $(window).load(function() { ... }); To $(window).on('load', function() { ... }); jquery.js:9612 Uncaught TypeError: url.indexOf is not a function This error message comes from jQuery.fn.load function. I've come across the same issue on my application. After some digging, I found