Click to See Complete Forum and Search --> : Passing-in Values


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

Jona
06-12-2003, 01:19 PM
Have you tested your code? It should work.

Jona

SearedIce
06-12-2003, 02:38 PM
d'oh...i really was thinking from too much of a C++ view...i forgot to put in "function " before the bringDown(whichmenu)