V
Vmrincon
Hi everybody!
I am trying to program a function in javascript and a funny
behaviour occurs.
If I execute this code:
aux=parseInt(year-birthyear);
return (aux)
The value that the output returns is NaN (Not a number) but if I
execute this another one...
aux=parseInt(year-birthyear);
alert('hi')
return (aux)
Then the value that the output returns is right
It looks like javascript doesn´t have time to update the aux
variable to send it properly as an output... does anyone know how to
fix this problem?
Thanks a lot!
Victor
I am trying to program a function in javascript and a funny
behaviour occurs.
If I execute this code:
aux=parseInt(year-birthyear);
return (aux)
The value that the output returns is NaN (Not a number) but if I
execute this another one...
aux=parseInt(year-birthyear);
alert('hi')
return (aux)
Then the value that the output returns is right
It looks like javascript doesn´t have time to update the aux
variable to send it properly as an output... does anyone know how to
fix this problem?
Thanks a lot!
Victor