I am writing my first Javascript-Program. I am new to this programming language, therefore I would be very thankful if you could keep the answers simple, so that I can understand them.
Here is my Code: http://jsfiddle.net/7Tfwh/1/
function temp(form) {
var umsatz = parseFloat(form.umsatz.value, 10);
var ebit = parseFloat(form.ebit.value, 10);
umsatzrendite = (ebit / umsatz)*100 + "%";
form.umsatzrendite.value = umsatzrendite;
};
All it does is take 2 variables out of a form and divide them and give back the result. I want to use many more variables, but the calculations will be done very quickly. I therefore would like to give the user the impression, that the calculation is a very complicated one and takes some seconds to post the results.
Therefore I would like to use a loading screen for 3 to 5 seconds, right after the user pushes the "calculating"-Button and of course before he gets the result.
Would be nice if someone could point me to the correct direction.
Thank you.
George
Ninjaedit: Btw I don't know why the Jsfiddle-Version doesn't work properly. On my local environment the calculation is done properly.