This question has been asked a couple of times before, also by me ;)
https://forum.mendix.com/link/questions/7418
The ready function does not add anything in terms of loading after the content / other widgets have loaded.
Good luck!
Hi Dan,
You can use the jquery ready function as well as a time out to make sure your page loads before the script is executed.
I usually use something along the lines of this.
jQuery(document).ready(function() {
setTimeout(function() {
}, 100);
});
Hope this helps!