Is there a way to get response headers of an iframe onload?
I have already googled it, but really I could not find something useful about it!
Is there a way to get response headers of an iframe onload?
I have already googled it, but really I could not find something useful about it!
Not really. If the iframe is on the same domain you can access its document object which contains some useful information such as
document.referrer
, but you cannot intercept the full HTTP headers without making an Ajax request for the URL. This would mean requesting the URL again. e.g:This will only work if the iframe src is in the same domain as the calling script.