Here is a javascript I wrote and works fine as an HTML file
Because I’m using it on multiple pages, I really want to make it into an external .js file. I moved
<img src=“Chrysanthemum.jpg” height=200 length=250 id=“rotator”>
into my HTML file and changed the rotation timer from a line to a function
function startrotation () {t=setInterval(“displaypix()”, 5000);}
so it can be called from the HTML file.
<input type=“button” onclick=“startrotation()” value=“Start Slideshow”>
So I run it and nothing. I checked and the
<script type=“text/javascript” src=“picturerotator.js”></script>
is in the HEAD section so the script should be loading. My thought is that as “rotator” is initialized in the HTML document, that when the javascript has to use it, it has no clue what to do. Any ideas?