Is it possible for javascript to read the ETAG value of a HTTP response?
Are there any issues in writing out an ETAG value in a HTTP Request to the server?
If it's a regularly loaded page, I think the HTTP request/response is already complete so Javascript can't access that information.
If it's an AJAX call, jQuery has the jqXHR object (documentation here), which says this.
The jQuery XMLHttpRequest (jqXHR) object returned by $.ajax() as of jQuery 1.5 is a superset of the browser's native XMLHttpRequest object. For example, it contains responseText and responseXML properties, as well as a getResponseHeader() method. When the transport mechanism is something other than XMLHttpRequest (for example, a script tag for a JSONP request) the jqXHR object simulates native XHR functionality where possible.
So you can call getResponseHeader()
on the returned object in your success call to parse them out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With