i created a javascript function that would calculate the total values of an array . (just addition) - and it did work and display correctly in that function.
i initialized the variable where i saved the total at the top of the javascript page (out side the function and initialized it to 0)
[HTML]total += parseInt(price[sha]);[/HTML]
but when i created another function in the intension of using that value ( the total which i calculated in the above function), i am getting a zero instead the value which was calculated .. ( i got the zero bcoz i initialized that variable to 0) .. even whe i removed the 0, it didnt work ...
how can i access the value of the total variable which i calculated above .. ?
cant we have global or universal variables in javascripts ?
is there any other technique where i can access that variable ?
plzzz provide me with a code ....
plzz help
i initialized the variable where i saved the total at the top of the javascript page (out side the function and initialized it to 0)
[HTML]total += parseInt(price[sha]);[/HTML]
but when i created another function in the intension of using that value ( the total which i calculated in the above function), i am getting a zero instead the value which was calculated .. ( i got the zero bcoz i initialized that variable to 0) .. even whe i removed the 0, it didnt work ...
how can i access the value of the total variable which i calculated above .. ?
cant we have global or universal variables in javascripts ?
is there any other technique where i can access that variable ?
plzzz provide me with a code ....
plzz help
Comment