Any ideas why this is kicking up a fuss for my jquery ajax call.
Sub SetJsonHeader()
Response.AddHeader "Content-Type", "application/json"
End Sub
something = Request.Form( "formLabel" )
SetJsonHeader()
Response.Write( "{ something: """ & something & """ }" )
The response.write is returning the correct string { something: "blabla" } but when I call it with my javascript it reports an error:
$.ajax({
dataType: "json",
url: "includes/Process.asp",
method: "POST",
data: {
process: "notrelevant",
formLabel: something
},
success: function (data) {
alert(data);
$(obj).replaceWith(data.casName);
},
error: function (a, b, c) {
alert(a.responseText + "
" + b + "
" + c);
// alerts
// { something: "blabla" }
// parse error
// syntax error invalid character
}
});