【发布时间】:2013-12-02 21:28:13
【问题描述】:
我在这里缺少什么?我的 jquery 函数没有触发。这是 HTML:
<div id="sum_income" class="col-sm-3" onload="sumIncome();">
</div>
这里是 jquery 函数:
function sumIncome() {
var cur_month = $('#month option:selected').attr("value");
$.ajax({
type: "POST",
url: 'inc/functions.php',
data: {action: "get_sum_income", cur_month:cur_month},
success: function(response){
$('#sum_income').html(response);
setTimeout(sumIncome, 5000);
}
})
};
【问题讨论】:
-
您在控制台中遇到了什么错误,请在此处写下您控制台的确切错误。
-
@NeerajKumar 他没有出错,我敢肯定。
-
@DontVoteMeDowm 我已经编写了可以正常工作的代码