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).
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=" ...
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" ></...