Hey everyone, I'm having a problem with the error message 'window.onload is not a function.' Here's my code:

<script>
window.onload = function() {
// Some code here
};
</script>

So, I'm trying to execute some code when the page loads, but I keep getting this error. Can someone please help me understand why this is happening and how to fix it?