//How to load the function after the window has loaded? $(window).on('load', function() { console.log('All assets are loaded') })