I know this is usually an issue of unbalanced parens and curly braces, however after carefully sifting through my syntax, I have, to the best of my ability, confirmed the correct parity of each of these scope delimiters and have no other recourse except to allow my fellow S.O. pundits to take a gander at the following:
$.ajax({
url: "/application/get_programs_for_center",
type: "POST",
data: formdata,
success: function(response){
var options = $("#school_application_program_name");
var result = JSON.parse(response);
console.log(result);
$.each(result, function() {
options.append($("<option />").val(this.id).text(this.name));
});
}
});
N.B. the error is being thrown in the middle of the line var result = JSON.parse(response); specifically immediately after JSON.
JSON.parsefunction itself becauseresponseis not a valid JSON string.