I tried so many tutorials online but everything I try is really old and fails - I can't even create an XMLHTTPRequest object!
I just want to get the header from google.com - how can I do that?
You would use
xhr.getResponseHeader() to get a single header, or
xhr.getAllResponseHeaders() to read all of the headers from an
The reasons this won't work for you:
XMLHttpRequestis case sensitive. If you are using
HTTPin all caps, it will fail.