I have several JavaScript functions that need to run when the page loads to fetch content. I have tried to use window.onload to call the function but it hasn’t worked.
Basically, need to run several functions after the page finishes loading but only once.
I have this so far but it didn’t work
<script language="javascript">
window.onload=serverstats
window.onload=latestnews
</script>
Here is your main issue:
You can fix this by doing:
However, as the question is tagged with JQuery, I would recommend using it and doing: