Can anyone tell me how to pass a variable that is established in one function on to a second function for further calculations.
The script I have now looks like this:
function price(size){
if (size==1) var a=.5;
if (size==2) var a=1;
if (size==3) var a=1.5;
if (size==4) var a=2;
if (size==5) var a=2.5;
if (size==6) var a=3;
if (size==7) var a=3.5;
if (size==8) var a=4;
if (size==9) var a=4.5;
if (size==10) var a=5;
if (size==11) var a=5.5;
if (size==12) var a=6;
parent.bottom.document.body.innerHTML=”your total is: $”+ a * len;
}
var shad=0;
function shadow(value){
if (value==1) var shad=2;
else var shad=1;
parent.bottom.document.body.innerHTML=”your total is: $”+ a * len
}
I keep getting an error with the second function that says ” a is undefined”
Again, I would like “var a” (which is established in function price() ) to be passed to function shadow() for further calculations.
Any help will be appreciated. Thank you.