JQuery getJSON - ajax parseerror

后端 未结 17 1901
南笙
南笙 2020-12-01 13:04

I\'ve tried to parse the following json response with both the JQuery getJSON and ajax:

[{\"iId\":\"1\",\"heading\":\"Management Services\",\"body\":\"

17条回答
  •  悲&欢浪女
    2020-12-01 13:19

    If anyone is still having problems with this it's because your response needs to be a JSON string and content-type "application/json".

    Example for HTTP in asp.net (c#):

    public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json";
            context.Response.Write("{ status: 'success' }");
        }
    

    hth,

    Matti

提交回复
热议问题