This code example below will show you how to execute a jQuery code only after a page is completely loaded. The benefit of this is to make sure a page already loaded before a jQuery code get executed.
$(window).on("load", function() {
customFunction();
});
The point is to use on("load")
with jQuery to execute a code after a page is completely loaded.