代码中存在错误 语法错误
$(function(){
$("#users").on("change", function(e){
/* values from select statement and assigning to a variable*/
var $filter = $("#users").val();
$.ajax({
/*sending variable to the controller */
url: "finance/finance_transaction/",
data: {filter: $filter},/* variable */
dataType: "html"
}).done(function(msg){
}).fail({});
)}; /*syntax error points here */
)};
它从select语句中获取值并将其发送到控制器
答案 0 :(得分:0)
你的结束括号会产生问题
$(function(){
$("#users").on("change", function(e){
/* values from select statement and assigning to a variable*/
var $filter = $("#users").val();
$.ajax({
/*sending variable to the controller */
url: "finance/finance_transaction/",
data: {filter: $filter},/* variable */
dataType: "html"
}).done(function(msg){
}).fail({});
}); /*corrected here */
}); /*corrected here */
答案 1 :(得分:0)
$(function(){
$("#users").on("change", function(e){
// ...valid code, skipped...
)}; /*syntax error points here */
)};
大括号不匹配。与HTML标记一样,无论您先打开哪一个都必须最后关闭。最后两行应该是:
});
});