If a <script>
has a src
then the text content of the element will be not be executed as JS (although it will appear in the DOM).
You need to use multiple script elements.
- a
<script>
to load the external script -
a
<script>
to hold your inline code (with the call to the function in the external script)scroll_messages();