4

I need a function that is called when the page is totally loaded (text, image, and so on).

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

markzzz
  • 45,272
  • 113
  • 282
  • 475

1 Answers1

18

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

$(window).on('load', function(){
  // insert code here
});
Enzero
  • 1,135
  • 2
  • 17
  • 36
Denys Séguret
  • 355,860
  • 83
  • 755
  • 726