let's say that I have a json file like this: http://www.example.com/json?jsonp=parseRespond
My HTML code:
<script src="http://www.example.com/json?jsonp=parseRespond"></script>
http://www.example.com/json?jsonp=parseRespond respond is:
{"id":"5572a7d648b33a462d79145d","avatarHash":null,"bio":"","bioData":null,"confirmed":false,"fullName":"Ender Widgin","idPremOrgsAdmin":[],"initials":"EW","memberType":"normal"}
How can I get the parsed respond header ? Here is what I have tried so far:
var _request = undefined;
var headers = _request.getResponseHeaders();
document.write(headers);
But , it doesn't work!
Note: I am not doing XMLHttpRequest because Origin is not allowed by Access-Control-Allow-Origin.
Note: I am not using callback=apiStatus as it redirects to an unauthorized link.
so the only way I can get response is when using jsonp=parseRespond , how can I write that response in a div ?