Hello Group,
Does anybody know how I can have a global variable in an HTML file? for
instance, I have a fuction (called aFunction() here) and during a
mousedown or up event the function is going to be called.
The third passing arugment or parameter is myGlobarVar. How can I make
this work? since myGlobalVar is defined in a different block of
javascript within the HTML file?
<html>
<head>
<title>testin g an HTML for global variable!</title>
<script type="text/javascript" src="myfile.js" >
var myGlobalVar = "S100";
aFunction();
</script>
</head<body>
My IMAGE
<img onmousedown= "javascript:aFu nction(ev, this, myGlobalVar);"
onmouseup="java script:aFunctio n(ev,this);" src="MyImage.gi f" border=0
></body>
</html>
Thanks in advance.
Amit.