Is there any way to get content type and content disposition of a url using java-script?
Thanks
Is there any way to get content type and content disposition of a url using java-script?
Thanks
Unfortunately, there isn't an API to give you the HTTP response headers for your initial page request.
Accessing the web page's HTTP Headers in JavaScript
Although you could make a new request and read those:
var req = new XMLHttpRequest();
req.open('GET', document.location, false);
req.send(null);
var headers = req.getAllResponseHeaders().toLowerCase();
alert(headers);