Technetium
06-28-2003, 07:56 PM
In the HEAD tag of the page, I have a short script block that just assigns a variable using:
<script src="jscript.js">
<!--
counter=0;
//->
</script>
From the tutorials I've read, this variable should be accessable from the rest of the page. I have an image with an onmouseover event, and for test purposes, this simply reads:
onmouseover="window.alert(counter)"
But nothing happens when I test it. Is there something else I need to do to be able to access the variable? I have tried moving the variable initialization into the top line of the .js file, thinking that maybe I had to have all my javascript in one place or the other, but it didn't help.
I am running Mozilla 1.2.1, and I do have Javascript fully enabled in the preferences.
<script src="jscript.js">
<!--
counter=0;
//->
</script>
From the tutorials I've read, this variable should be accessable from the rest of the page. I have an image with an onmouseover event, and for test purposes, this simply reads:
onmouseover="window.alert(counter)"
But nothing happens when I test it. Is there something else I need to do to be able to access the variable? I have tried moving the variable initialization into the top line of the .js file, thinking that maybe I had to have all my javascript in one place or the other, but it didn't help.
I am running Mozilla 1.2.1, and I do have Javascript fully enabled in the preferences.