Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- How do i return a value from a closure function?


nelsonm - 12:41 pm on May 30, 2012 (gmt 0)


It worked! thanks a lot.

BTW, it was said on another post that i should do calculations on the server side because toFixed may give different results in different browsers. Do you agree with that?

In any case, i do agree that you should hold off using toFixed until your ready to display the data.

One more thing...
assigning the anonymous function to variable "updateForm" does not create a closure - right? I think calling "updateForm" from the post method callback function creates closure - am i correct or am i still hopelessly lost on the concept of closures?

[edited by: nelsonm at 1:25 pm (utc) on May 30, 2012]


Thread source:: http://www.webmasterworld.com/javascript/4459277.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com