To call a JavaScript function after script is loaded, we set the onload
attribute.
For instance, we write
<script onload="loadedContent();" src="/myapp/myCode.js"></script>
to set the onload
attribute to call the loadedContent
JavaScript function.