I have some JavaScript code:
var update_money = function(money_am){
var d = {'ammount': money_am};
$.post("/adr/", d, load_money)
}
z = parseFloat($('#money').val());
$('#money').change(z, update_money);
When it executes, it gives me a runtime error:
TypeError: 'stopPropagation' called on an object that does not implement interface Event.
In debug, I found that money_am is not a float. It is an object. But if I change my code like this:
var update_money = function(money_am){
var d = {'ammount': parseFloat($('#money').val())};
$.post("/adr/", d, load_money)
}
It works great. What should I do to fix this problem?