insertAfterJs('myfile.js') was trying to insert after the last <script>
tag rather than the last </script> tag