$ still needed for this project

Only 3 days left to fund this project.
Join the 0 other donors who have already supported this project. Every dollar helps.
Why give $50? Help 10 Children every month!
如题,每次点击提交按钮numFunded都会跟着变化,现在想计算numFunded占numTotal的百分比,用进度条显示出来。但是计算出来的percentage都是0,想问大家代码错在哪里,怎么改呢?谢谢
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
看你代码,累的眼疼~
解决方案:把函数里面最后一句话
var percentage=......的var去掉就可以啦。理由:函数内声明变量,导致内部变量覆盖外部变量。