AJAX request returns 200OK but fails despite return data being JSON

前端 未结 1 1037
醉梦人生
醉梦人生 2021-01-28 01:16

Edit: In my case, The the reason that it was not returning to correct information is that I was trying to use JSONP to connect to a CORS data setup, wherea

1条回答
  •  醉梦人生
    2021-01-28 01:49

    The response is:

    Content-Type:application/json
    ["Asset","AssetElementDefMap",…,"WorkingSet"]
    

    That's no JSONP script, but plain JSON (the "padding", ie. the callback function, is missing). Since the request is cross-domain, you're not allowed to access it - and executing it as a script fails even when the resource loads with a 200 OK status.

    0 讨论(0)
提交回复
热议问题