JavaScript Getting all response headers from jqXHR get response headers javascript,get response headers,get response headers

On my server (written in Go), I'm sending back a custom header field that I'm trying to read from when I make an ajax call.

$.ajax({
        url: url,
        success: function(data, status, request) {
            console.log("Custom field: " + request.getResponseHeader('Custom-Header')); 

            // doing stuff with data
        }
});

The response

HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Custom-Header: some,comma,separated,stuff,here
Content-Type: text/csv
Date: Mon, 10 Aug 2015 15:42:34 GMT
Content-Length: 1379

This will always return null. I tried using getResponseHeader for regular headers that I've confirmed are in the response packet, such as Content-Length, Date, and Access-Control-Allow-Origin; these all return null as well. The only header that works is Content-Type.

If I use getAllResponseHeaders(), it returns a string with just Content-Type: text/csv.

How do I access other headers that are not Content-Type? I saw that there was a bug related to this 3 years ago, but only affected Firefox. I'm using Chrome v 44.0.2403.130 (64-bit).

Answer:1

I have one item-row.js component for each line in the CRUD and a button that triggers that "addNewItem" because I need to do some extra processing. Well, the action never bubbles up to the route, so ...

I have one item-row.js component for each line in the CRUD and a button that triggers that "addNewItem" because I need to do some extra processing. Well, the action never bubbles up to the route, so ...

I'm building dynamic drop downs for an order form for additional options. When selected these options increase the value for a dynamic amount. The drop downs are organized as such: <option value=" ...

I'm building dynamic drop downs for an order form for additional options. When selected these options increase the value for a dynamic amount. The drop downs are organized as such: <option value=" ...

  1. javascript select value from object
  2. javascript select value from dropdown
  3. javascript select value change
  4. javascript select value text
  5. javascript select value from array of objects
  6. javascript select value from array
  7. javascript select value option
  8. javascript select value selected
  9. javascript select value set
  10. javascript select value change event
  11. javascript select value onchange
  12. javascript select value null
  13. javascript select value get
  14. javascript select value undefined
  15. javascript select value of input
  16. javascript select value in input field
  17. javascript select value empty
  18. javascript select value programmatically
  19. javascript select value from json
  20. javascript select value from drop down list

Say i have conditions setup like this: if (condition1) { for (var i in objx) { if (objx[i] == 3) { //go to next else if } } } else if(condition2) { ... } so there ...

Say i have conditions setup like this: if (condition1) { for (var i in objx) { if (objx[i] == 3) { //go to next else if } } } else if(condition2) { ... } so there ...

I have a datalist that looks like : <datalist id="foodlist"> <option value="one" ></option <option value="two" ></option> <option value="three" ></...

I have a datalist that looks like : <datalist id="foodlist"> <option value="one" ></option <option value="two" ></option> <option value="three" ></...