Simple question. I'm trying to return the result for calculation of "xout" from the function test() below. Instead of the result "xo = 4), I get xo is "undefined", I'm missing something basic here. Eventually, I want to return the results of many calculations from the function test().
Any help would be appreciated. Thanks.
Any help would be appreciated. Thanks.
Code:
<html>
<head>
<title>Test Function</title>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
function test(xin, xout){
alert("xin = " + xin);
xout=xin*2;
}
var x=2;
var xo;
javascript:test(x, xo);
alert("x = " + x);
alert("xo = " + xo);
</SCRIPT>
</body>
</html>