View Single Post
Old 03-27-2003, 02:23 PM   #3 (permalink)
saline
I am red.
 
saline's Avatar
 
Join Date: Feb 2003
Location: Cleveland, OH
Posts: 139
saline is on a distinguished road
abc123 is right but I also just wanted to add one little thing. I copied your code into the program I use to edit javascript and guess what I found. final, the variable your using to hold the total, is technically a reserved word in javascript.

If you don't know what I mean by reserved word it's the keywords that the interpreter or compiler looks for like 'if' or 'for' or 'while'.

Strange thing is, final is reserved for future use, which means, at least right now, it doesn't do anything. So its ok to use but if someday someone uses your script on a browser where final is specified your script will crash and burn.

I would recommend using the variable name 'total' instead of final or maybe 'final_total' just to be super specific.

welcome to codenewbie!
saline is offline   Reply With Quote