I have this javascript function here for example:
<script type="text/javascript">
function onLoadFunctions() {
//some funcitons here...
}
</script>
And I wanted to load this function when the page loads using only javascript. Can anyone help me. thanks in advance.
If I understand what you're asking you probably want to use window.onload.
<script type="text/javascript">
function onLoadFunctions() {
//some funcitons here...
}
window.onload = onLoadFunctions;
</script>
You can also use body onload event:
<body onload="onLoadFunctions();" ...>
...
</body>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With