SearedIce
06-12-2003, 01:17 PM
How can I pass values from one function to another...when I try, Internet Explorer says "Object Expected":
<html>
<head>
<script langauge="javscript">
var whichmenu;
bringDown(whichmenu)
{
alert(whichmenu);
}
</script>
</head>
<body>
<div onMouseOver="bringDown('popdown1');" style="border: solid #000000 1px; position: absolute; top: 10px; left: 10px; width: 100px; height: 20px">
MENU1
</div>
<div onMouseOver="bringDown('popdown2');" style="border: solid #000000 1px; position: absolute; top: 10px; left: 110px; width: 100px; height: 20px">
MENU2
</div>
<div id="popdown1" style="border: solid #000000 1px; position: absolute; top: 30px; left:10px; width: 50px; height: 20px; visibility: hidden">
POPDOWN1
</div>
<div id="popdown2" style="border: solid #000000 1px; position: absolute; top: 30px; left:60px; width: 50px; height: 20px; visibility: hidden">
POPDOWN2
</div>
</body>
</html>
I've got two divs at top, that when "onMouseOver[ed]" will call the bringDown(whichmenu) function with a string determining which menu to bringDown...
Right now all I have in the bringDown function is the alert for testing purposes.
I scripted this from a C++ point of view...what's the syntax for function parameters in Javascript?
~John
<html>
<head>
<script langauge="javscript">
var whichmenu;
bringDown(whichmenu)
{
alert(whichmenu);
}
</script>
</head>
<body>
<div onMouseOver="bringDown('popdown1');" style="border: solid #000000 1px; position: absolute; top: 10px; left: 10px; width: 100px; height: 20px">
MENU1
</div>
<div onMouseOver="bringDown('popdown2');" style="border: solid #000000 1px; position: absolute; top: 10px; left: 110px; width: 100px; height: 20px">
MENU2
</div>
<div id="popdown1" style="border: solid #000000 1px; position: absolute; top: 30px; left:10px; width: 50px; height: 20px; visibility: hidden">
POPDOWN1
</div>
<div id="popdown2" style="border: solid #000000 1px; position: absolute; top: 30px; left:60px; width: 50px; height: 20px; visibility: hidden">
POPDOWN2
</div>
</body>
</html>
I've got two divs at top, that when "onMouseOver[ed]" will call the bringDown(whichmenu) function with a string determining which menu to bringDown...
Right now all I have in the bringDown function is the alert for testing purposes.
I scripted this from a C++ point of view...what's the syntax for function parameters in Javascript?
~John