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;
}
}
With the above code I am trying to send 2 ajax requests, one to go to insertpenaltymarks.php page and the other to go to the sessioncomplete.php and complete.php page. But I am getting an error I don’t really quite understand:
Syntax error at line 57 while loading: expected '}', got 'success'
success:function(res
What does this error actually mean and how can it be fixeD?
Set comma after
"POST"in the first Ajax call: