JQuery jsonP headers

Does anyone know how I can get headers from a response to a jsonp request? docs do not specifically mention that this is not supported, but getReponseHeader always returns null for a header that interests me. Can't get headers for request when response is script?

Google Chrome shows the header returning with the response, but I just can't grab it from the jqXHR object.

+4
source share
1 answer

No, unfortunately, no: if the request is executed using the <script> , the browser will generally not allow access to any of the headers from JavaScript. The jqXHR object created by jQuery does not have the ability to retrieve these headers, because technically this request is not obtained.

+4
source

Source: https://habr.com/ru/post/1479446/


All Articles