If $ (window) .load () is out of date, what should I use?

I need a function that is called when the page is fully loaded (text, image, etc.).

I noticed that $(window).load() now deprecated. So what should I use?

+4
source share
1 answer

If you just want to avoid the load function, use the generic on function:

 $(window).on('load', function(){ // insert code here }); 
+15
source

Source: https://habr.com/ru/post/1482567/


All Articles