任何想法为什么这会让我的jquery ajax电话大惊小怪。
Sub SetJsonHeader()
Response.AddHeader "Content-Type", "application/json"
End Sub
something = Request.Form( "formLabel" )
SetJsonHeader()
Response.Write( "{ something: """ & something & """ }" )
response.write返回正确的字符串{something:“blabla”} 但是当我用我的javascript调用它时会报告错误:
$.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 + "\n" + b + "\n" + c);
// alerts
// { something: "blabla" }
// parse error
// syntax error invalid character
}
});