Forum Moderators: open
Started out a couple of hours ago wanting to place multiple images in .js files complete with links and alts. The files I then plan to rotate on load.
Problem, for some reason I can't even a single image to load from the .js file. All files and the gif are in the same folder. I can change the test.js for a simple script showing the date etc. and that pops up fine. I can paste the <img src="aliens.gif" width="70" height="59"> into the body bypassing the test.js file and it works fine. But place it in the test.js and it throws some sort of syntax error. Maybe it's just me only having 4 hours sleep in the last 30 or maybe it's just that i haven't used .js before. Please put me out of my misery before I take up monitor throwing.(ok a few pencils then.)
contents test.js file.....
<img src="aliens.gif" width="70" height="59">
contents test.html body.....
<script src="test.js" language="JavaScript"></script>
I just want to load several small images on page load to use as a pictorial menu. Storing them as .js and rotating the .js seems to be the simplest solution.
I have simplified it down to a single image to try to work out why it will not work but I can't even get the single image to load from the .js .
I'm missing something, I have even uploaded it and changed the paths to full url in case it was a local problem.