myClickHandler = function(e) {
var ng = $('#num_groups').val();
for (var group = 1; group <= ng; group++) {
if (!validation(group)) return false;
}
if (confirm("Are you sure you want to Proceed?" + "\n")) {
$.ajax({
url: "insertpenaltymarks.php",
data: $("#PenaltyMarks").serialize(),
async: false,
type: "POST"
success:function(result){
$.ajax({
url: "sessioncomplete.php",
async: false,
type: "POST",
success:function(response){
window.location = "complete.php";
}
});
}
});
return true;
} else {
return false;
}
}
与上面的代码我想送2个Ajax请求,一来一去insertpenaltymarks.php
页面和其他去sessioncomplete.php
和complete.php
页。但我得到一个错误,我真的不很明白:预期}获得成功发现错误
Syntax error at line 57 while loading: expected '}', got 'success'
success:function(res
是什么错误实际上意味着,以及如何可以把它固定?在第一个Ajax调用"POST"
后
语法错误应该通过检查你的代码和/或通过验证检查运行它是固定的。 – 2013-02-14 20:09:13