To execute script injected by innerHTML after AJAX call with JavaScript, we put our code in a script block.
For instance, we write
<script type="text/javascript">
function myFunction() {
//...
}
myFunction();
</script>
to add a script block that has the myFunction
function.
We call it after it’s defined.