Talk:Adding Two Numbers - JS: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
(isNaN not working)
 
No edit summary
 
Line 1: Line 1:
The error checking code is not working, at least on my computer.  I tried the isNaN in a simple app with just a text box and button but it would not work.  I tried copying the code in the tutorial but that didn'w work either.  If I typed in one number and nothing in the other box, I simply got NaN in the Total box, but no alert.  Any idea what I am doing wrong? Is it just me?
The error checking code is not working.  I tried copying the code in the tutorial but that didn't work either.  If I typed in one number and nothing in the other box, I simply got NaN in the Total box, but no alert.   
 
I changed the code to assign numbers to FirstNumber and SecondNumber variables, then did the isNaN on those variables instead. That worked fine.


Thanks
Thanks
ANdy
Andy

Latest revision as of 11:37, 15 September 2015

The error checking code is not working. I tried copying the code in the tutorial but that didn't work either. If I typed in one number and nothing in the other box, I simply got NaN in the Total box, but no alert.

I changed the code to assign numbers to FirstNumber and SecondNumber variables, then did the isNaN on those variables instead. That worked fine.

Thanks Andy