Question
Java Script in external *.js files
I have some Java Script functions that I need to include in
several topics. If I place them in the header section of a HTML
file all works fine. But this is cumbersome because I have to copy
all the functions to each topic file.
Then I thought I could place the scripts into a separate "MyScripts.js" and include them using
<script src="MyScripts.js" type="text/javascript"></script>
But obviously this is not the way to do it. Nothing goes anymore. I also tried to place the file in the baggage. It does not make any difference whether I include the file in the Header- or Body-sections.
Can anybody tell me how to properly use functions and variables from a script file? Thanks a lot.
Walter
Then I thought I could place the scripts into a separate "MyScripts.js" and include them using
<script src="MyScripts.js" type="text/javascript"></script>
But obviously this is not the way to do it. Nothing goes anymore. I also tried to place the file in the baggage. It does not make any difference whether I include the file in the Header- or Body-sections.
Can anybody tell me how to properly use functions and variables from a script file? Thanks a lot.
Walter
