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
  • 47,390
  • 120
  • 299
  • 507

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,141
  • 2
  • 17
  • 36
Denys Séguret
  • 372,613
  • 87
  • 782
  • 758