why $(window).load() is not working in jQuery?

后端 未结 4 1202
忘了有多久
忘了有多久 2020-11-27 06:18

I\'m learning jQuery using visual studio and testing my code in Chrome browser. This is my HTML code




        
4条回答
  •  伪装坚强ぢ
    2020-11-27 06:51

    You're using jQuery version 3.1.0 and the load event is deprecated for use since jQuery version 1.8. The load event is removed from jQuery 3.0. Instead you can use on method and bind the JavaScript load event:

     $(window).on('load', function () {
          alert("Window Loaded");
     });
    

提交回复
热议问题